This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compiler option

On Wed, 1 Mar 2006, Basavaraj Hiremath wrote:

> Hi,
> I am compiling a file(strerror.c) with following
> option
> -bash-2.05b$ arm-wince-pe-gcc -mcpu=xscale -c -ansi
> -D__stdcall= -D_OFF_T_ -DHAVE_CONFIG_H
> -I/usr/local/wince/cross-tools/include -I. -I./../include -W -Wall
> -Wtraditional -pedantic ./strerror.c -o pic/strerror.o
> It's giving following compilation error
> /strerror.c:626: error: expected identifier or '('
> before string constant
> /strerror.c:628: error: expected identifier or '('
> before '{' token
> file strerror.c has following function
> char *
> strerror (errnoval)  -> line 626
>   int errnoval;
> {                    --> line 628
>   const char *msg;
>   static char buf[32];
> -----------
> -----
> }
> Could somebody tell me, what is the compiler option to go pass thru this
> kind of implementation?

You are compiling a K&R-style C function header in ANSI mode -- of course
you're getting an error.  Either remove the -ansi flag, or fix the file to
use ANSI-style declaration.

Google for "k&r ansi" for innumerable resources on this.  Oh, and this has
nothing to do with Cygwin.
      |\      _,,,---,,_ |
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]