2

I have a final exam next week, and in the exercise paper which is given us to study, there is a gcc option that I could not find on gcc manual page.

It is something like that gcc -J 4 program.c -o filename.

Is there someone knows that what it is for?

Braiam
  • 35,991
lasey
  • 39
  • 3
    Sorry but it's borderline stupid to ask you to use an undocumented option if it's not covered in your course manual. – Julie Pelletier Jun 03 '16 at 22:08
  • gcc will complain with a lower case j : -j 4 : unrecognized command line option ‘-j’ . gcc: error: 4: No such file or directory. ... But is OK with -J 4 , i.e. an upper case J. - – Knud Larsen Jun 03 '16 at 23:10
  • @JuliePelletier I bet is an old gcc version – Braiam Jun 03 '16 at 23:31
  • 1
    I tried skimming the sources at github https://github.com/gcc-mirror/gcc/blob/master/gcc/opts-global.c and the online documentation https://gcc.gnu.org/onlinedocs/. Nowhere is documented. Gfortran has a -J defined https://gcc.gnu.org/onlinedocs/gfortran/Directory-Options.html – Braiam Jun 03 '16 at 23:49
  • Your instructor as asking you to memorize compiler command-line options? That's what documentation is for. Requiring you to memorize command-line options isn't borderline stupid. It's useless - you'll get them wrong anyway, and they change over time. It's completely stupid - full stop. – Andrew Henle Jun 04 '16 at 00:00
  • @AndrewHenle, certain basic options should be memorized, but they would be best committed to memory by frequency of use, not by dedicated efforts to memorize. And certainly the student should know what options there are even if he doesn't remember the exact flags for them. – Wildcard Jun 04 '16 at 00:02
  • @Wildcard The common ones will likely be memorized - i.e., -c, -o. You are going to look up the others almost every time anyway, unless you use them enough to remember them. Then they'll change. It's still stupid to require a student to memorize them, and then base the student's grade on that. It's like having a student auto mechanic memorize where a specific part is on the shelf at the one local AutoZone auto parts store. "In what aisle and on what shelf is the left-hand muffler valve in the 4th Ave Auto Zone?" – Andrew Henle Jun 04 '16 at 00:07
  • @AndrewHenle, I agree with the proclaimed stupidity of grading students based upon memorization—full stop. I disagree with your analogy. To use a tool you should learn the tool. The fact that later tools will obsolete aspects of the tool you have is irrelevant. That's more like saying that an auto mechanic doesn't need to learn what a carburetor looks like because cars of the future (electric) won't have carburetors. Carburetors will change. So what? Who will fix them in the mean time? – Wildcard Jun 04 '16 at 01:27
  • All is right , but I still need to learn it, somehow :) – lasey Jun 04 '16 at 09:25
  • 1
    Since you wrote -J 4, as in with a number, and, since it doesn't seem to match anything in gcc, I wonder if this is confused with the -j <N>option of make. In make, it sets the maximum number of compilations to run in parallel: on a four-processor system one might run make -j4 to utilize all processors. – ilkkachu Jun 04 '16 at 10:04

1 Answers1

2

There's only a Gfortran specific option called -J, but this doesn't make sense combined with a number. Other alternative is that is being confused with make -j n flag that determines the maximum number of concurrent compilation process.

Braiam
  • 35,991