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

Re: A silly question about GCC



Gilad Ben-Yossef wrote:
> Now, if I put it in as a const static variable like so:
> const static char * Ver = "$Id$";

try making it an array of char, as in:
const static char Ver[] = "$Id$"

compiling the following with "gcc hello.c -Wall -ansi -pedantic -o
hello" gives me no errors. 

#include "stdio.h"

const static char version[] = "version0.0";

int main(int argc, char ** argv){
     printf("%s\n", "hello world!");
     return 0;
}

btw, you can see in a lot of older code this sort of declaration wrapped
in 
#ifndef LINT

#endif
since lint complains about this sort of thing. 

> Thanks,
> Gilad.
> 
-- 
mulix

linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il