-27

This question is exactly the type of question/answer Stack Overflow needs:

If we compile a C++ program on an Intel processor without using any processor-specific feature, would it run on some other company's processor without recompiling?

I see thousands of my-code-doesn't-work "questions" flow through this site, and then something like this, which is an excellent question, gets closed?

I am baffled. What are curating users on this site looking for?

20
  • 18
    How is it an excellent question? It's based on a false premise that requires no research effort to come to. Almost any research on what a compiler does and what machine code is would have shown that C++ is generally compiled into a architecture specific instruction set. Commented Apr 9, 2023 at 17:44
  • 6
    "I am baffled by what the moderators on this site are looking for." As far as [I can tell](stackoverflow.com/posts/75971895/timeline, no moderators have had any involvement in that question (unless you count Henry Ecker's edit of this question here on Meta).
    – Thom A
    Commented Apr 9, 2023 at 17:48
  • But isn't SO the place where people will go to do this research? What percentage of questions asked and answered here can't be answered by researching elsewhere? Why even have this site?
    – pamphlet
    Commented Apr 9, 2023 at 17:49
  • 4
    So what research did you do before you asked that question, @pamphlet ? What about the content you read didn't you understand?
    – Thom A
    Commented Apr 9, 2023 at 17:50
  • 1
    How does a question get closed except via the process of moderation? Maybe there's a bunch of lingo/jargon w.r.t. to the operation of this site that I'm not familiar with, and if that's confusing matters I apologize.
    – pamphlet
    Commented Apr 9, 2023 at 17:50
  • 1
    No, that would be meta-commentary and would (likely) be removed.
    – Thom A
    Commented Apr 9, 2023 at 17:53
  • 10
    There are 1,000's of questions posted on Stack Overflow every day, @pamphlet , and not enough users curate that content; not enough poeple use their down/close vote privileges. This means that bad questions slip through the cracks and end up not being closed. The existence of other bad questions doesn't make bad questions permissible.
    – Thom A
    Commented Apr 9, 2023 at 17:59
  • 12
    Yes really, @pamphlet . You have about 100 undeleted posts, so some understanding of how the site works (such as that it uses community curation) would be expected.
    – Thom A
    Commented Apr 9, 2023 at 18:02
  • 1
    The question is unclear. What do "compile a C++ program" & "compile a C++ program on an Intel processor" & "compile a C++ program on an Intel processor without using any processor specific feature" mean? Note that if the asker was actually acting in a specific way reasonably describable by those they could give relevant details of a system, input, desired output, any output & what they were running. As it is, even for whatever general category of situations they think they have in mind they happen to have written something too vague to answer. PS Posters should clarify via edits, not comments.
    – philipxy
    Commented Apr 9, 2023 at 21:37
  • 3
    “But isn't SO the place where people will go to do this research?” - No; It’s not. 5 minutes of research would have indicated that the output compilers create are architecture (processor) specific. Commented Apr 9, 2023 at 22:09
  • 1
    @ThomA "should I edit the question to say I am baffled by what the users of this are looking for?" "No, that would be meta-commentary" I expect that the asker here meant replacing "moderators" by (curating) "users" in this meta question, which is appropriate & which I have done, but that you thought they meant the main site question.
    – philipxy
    Commented Apr 9, 2023 at 22:50
  • 1
    If I try copying and pasting your question title into a search engine, after your question and this meta question, the next results I get are stackoverflow.com/questions/14694719 and stackoverflow.com/questions/32168380. Commented Apr 10, 2023 at 1:42
  • 4
    Aside from the lack of clarity, it is generally not useful to ask about hypotheticals - "in X situation, would Y happen?" Either X situation can be readily created (perhaps, by someone else) - in which case the correct approach is to try it (or ask/pay someone else to try it; the place for that is a discussion forum, not Stack Overflow) and see whether Y happens - or it cannot, in which case it does not matter. Commented Apr 10, 2023 at 1:47
  • 1
    Generally, suitable questions for Stack Overflow are either how-to questions - "what situation is required for Y to happen?" - or why (often described as "debugging" questions; but we will not find the bug for you, you are expected to create a MRE) questions - "I created X situation; why didn't Y happen? / Why did Z (which is not Y) happen?" Commented Apr 10, 2023 at 1:50
  • 2
    Thanks all for your feedback on this. I do regret the hyperbole I used in phrasing this (meta) question. The original SO question wasn't mine, and I have been convinced that it was not a good question for several reasons. I do (personally) think a question on why do programs need to be separately compiled for different architectures is a good (if basic) question, and wish SO had more of that kind of content. But OP's question was not that. And my championing of it was confusing and unnecessarily confrontational. Apologies and thanks to all who took the time to engage on this--it's appreciated.
    – pamphlet
    Commented Apr 10, 2023 at 4:29

1 Answer 1

24

The question is too unclear/unspecific in several areas.

If we compile a C++ program on an Intel processor without using any processor specific feature. Would it run on some other company's processor without recompiling?

  1. It's very unspecific. Some other company's processor: Should an author include a list of all available processors and state if it is likely that the program will run there? The OP certainly has something in mind when they ask. Maybe they're only asking about other desktop processors? Maybe about ones for mobile phones? Maybe some embedded system processors?

  2. It's unclear if the OP really thinks that the processor on which a program gets compiled matters (which would be a false premise of the whole question) or if the OP actually asks about a program that is compiled for a specific processor.

  3. Processor manufacturer != processor architecture != supported instruction set. Intel produces different processors with different architectures. A program that runs on an x64 intel processor might not run on an x86 intel processor, but on an x64 AMD processor.

  4. The question completely ignores the problem of operating systems. A program that runs on a processor on one operating system might not run on the same processor on a different OS.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .