Tuesday, April 12, 2022

[SOLVED] Find out what a given gcc Option/Flag is doing?

Issue

I have a project where I was given several Makefiles wich also do Precompiler-Work with Pro*C. They have to be migrated from HP-Unix to a linux system. No problem so far, but in some ways I can't figure out (or still haven't found the right google keywords) what some given options / flags in the gcc call are doing.

Consider following for example:

FLAGS_C=-Ae -v
FLAGS_PROC=-g +Z -Ae +M2

I have not found anything in the man page regarding -Ae or +Z +M2, but just calling them on the shell shows me that they exist - but not what they will do or are awaiting.

From the output of make I can only see that +Z or +M2 seem to await a directory which is not present.

$ gcc +Z 
gcc: +Z: No such file or directory 
gcc: no input files

The output is then followed by:

<command-line>: error: missing '(' after predicate

Because of some more Makesfiles I have not yet seen I was wondering if there is any good resource out there that can help me figure out what unknown options / flags are.

gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]

Edit: As others have mentiond +Z +M2 may definetely be no gcc option. So maybe possible that my interpretation of the gcc +Z call is just wrong understanding.


Solution

GCC docs have an overview page for all of the few hundred options it has: https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html

  • -Ae is probably the -A preprocessor option with predicate name e

-A predicate=answer

Make an assertion with the predicate predicate and answer answer. This form is preferred to the older form -A predicate(answer), which is still supported, because it does not use shell special characters.

FLAGS_PROC do not seem to be gcc options. I never heard of any option like +Z or +M2 and my GCC rejects them.

They might be HPUX linker options... ?

You didn't say which version of HPUX you are using, which may be of interest. The +z/+Z options AFAIK are relevant to HPUX only, not to gcc or binutils. If your gcc is set up the usual way, using gnu as, only the HPUX linker is used from the standard HPUX set of tools. You could check 'man ld' to see if those options are relevant to HPUX ld. Sorry, I am no longer employed where I had access to HPUX.

https://groups.google.com/d/msg/gnu.gcc.help/iWt83RMbt-8/rsAQ14_r-jgJ



Answered By - dom0
Answer Checked By - Clifford M. (WPSolving Volunteer)