What are good options for C compiler listings?

I’ve been doing work in Unix on z/OS, compiling C programs (many times). Most of the time I do not need the listing, because the messages from the compiler blocate the problem. However some times I need the listing because the error is in a different place.

I use a bash script to execute compile, and use variables to hold different versions of the compile options. I simply move the line to the bottom of the group

p8="-Wc,LIST(c.lst),SOURCE,NOWARN64 " 
p8="-Wc,LIST(c.lst),SOURCE,SHOWINC,XREF,INFO(USE) "
p8=" "

The last line has no -Wc options, and so no listing is produced.

The options mean

  • -Wc this specifies options for the compile operation
  • LIST(c.st) put the listing in the specified file
  • SOURCE include the top level source
  • SHOWINC print the included files. The NOSHOWINC suppresses any INCluded files.
  • NOWARN64 this is useful if you are writing a program which may be compiled with 64 bit
  • XREF show the attributes of the variables, and where they are referenced.
  • INFO(USE) this provides extra information, USE says report variables defined, but not used.

Leave a Reply