[ Resending: I sent this yesterday from a different email account,
and it seems not to have made it to the list. Apologies if you see
multiple copies ]
Hello,
A conversation last week sent me looking for a Studio compiler
equivalent to the gcc -fno-common command line option:
-fno-common
In C, allocate even uninitialized global variables in
the data section of the object file, rather than
generating them as common blocks. This has the effect
that if the same variable is declared (without "extern")
in two different compilations, you will get an error
when you link them. The only reason this might be
useful is if you wish to verify that the program will
work on other systems which always work this way.
It was suggested that I might mention that option in a blog entry I
wrote some time ago on the dangers of tentative data:
http://blogs.sun.com/ali/entry/what_are_tentative_symbols
I googled, and also searched the C compiler user guide PDF, and didn't
find one. I thought I'd ask the question here --- do we have a command
line option for this?
Thanks...
- Ali
_______________________________________________
tools-compilers mailing list
[email protected]