Re: g++ -D compiler options
- From: Daniel Franklin <daniel@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 26 Mar 2008 06:10:44 -0000
Mark Hobley wrote:
What are the effects of the -D options?
-Ddebian
-D_GNU_SOURCE
-DUSE_TERMIO
-DKLUDGELINEMODE
These effectivly insert #defines in the preprocessor stage. Hence if you
compile with -Ddebian, and in your code you have
#ifdef debian
some code
#else
some other code
#endif
The -Ddebian is equivalent to inserting a line which says
#define debian
at the top of the C file you're currently compiling.
Instead of debian you could substute BobTheBuilder and it would still do the
same. It's just a symbol. The _GNU_SOURCE has a particular meaning in the
GNU C library (and a few other places) - it makes the header recognise
certain GNU extensions which are not quite POSIX-compliant (e.g. if you want
to have the strsignal() function available in string.h you have to define
_GNU_SOURCE before including it - you can do that using this flag).
Cheers,
- Daniel
--
*************************************************************************
* Daniel Franklin - Lecturer in Computer Engineering
* University of Wollongong, NSW, Australia * d.franklin at ieee.org
*************************************************************************
.
- Follow-Ups:
- Re: g++ -D compiler options
- From: Roger Leigh
- Re: g++ -D compiler options
- References:
- g++ -D compiler options
- From: Mark Hobley
- g++ -D compiler options
- Prev by Date: Re: Alternative to glade?
- Next by Date: Re: Alternative to glade?
- Previous by thread: Re: g++ -D compiler options
- Next by thread: Re: g++ -D compiler options
- Index(es):
Relevant Pages
|