Gilad Ben-Yossef <[EMAIL PROTECTED]> writes:

> Hi,
> 
> I have a program which I want it's binary to contain a "version string",
> the kind of string RCS automagically makes for you if you ask it nicely.
> 
> Now, if I put it in as a const static variable like so:
> const static char * Ver = "$Id$";

I use 

static const char RCSid[] = "$Id$";

and gcc never complains even though I switch all conceivable warnings
on during development. What warning option generates the complaint?

Actually, I just did the following:

static const char RCSid[] = "$Id$";
static const char * Ver = "$Id$";

int main(void) {return 0;}

(note that static should go before const, otherwise there is an
additional complaint), and compiled to get a warning about Ver
but not about RCSid. I have no time to investigate now, but I
hope it helps.

For the record, I used

gcc -c \
    -W \
    -O2 \
    -pedantic \
    -Wall \
    -Wtraditional \
    -Wshadow \
    -Wid-clash-32 \
    -Wpointer-arith \
    -Wcast-qual \
    -Wcast-align \
    -Wconversion \
    -Wstrict-prototypes \
    -Wmissing-prototypes \
    -Wmissing-declarations \
    -Wnested-externs \
    <filename.c> -o /dev/null


-- 
Oleg Goldshmidt <[EMAIL PROTECTED]> 
"... We work by wit, and not by witchcraft;
 And wit depends on dilatory time." [Shakespeare]

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to