Re: The g++ -fconserve-space flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ferad,

Sounds like you have header files that are defining symbols, when what you
want is for the header files to declare them (not define them).

Take a look at Stroustrup's C++ Programming Language (special edition, or
third edition) section B.2.2 "C Code That Is Not C++".

This is valid C, but not valid C++:
int foo;
int foo;

In C, only one foo is defined.

In C++, the second foo causes an error in the translation unit.  (And if the
int foo is in different translation units, it causes an error at link time.
Violation of ODR.)

In C++, you may need to do this in your header files:

extern int foo; // Declaration, not a definition.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux