This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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]

char vs char*


Dear GCC-help,

I don't know if this is a bug, but I suspect that it is.

Consider the following two declarations, which compile fine:

1 static char __attribute__((weakref("LNU__strmats__LNU"))) strmats(char* s, char* m, int* l, unsigned int options) __attribute__((nonnull));
2 static char* __attribute__((weakref("LNU__strmat__LNU"))) strmat(char* s, char* m, int* l, unsigned int options) __attribute__((nonnull));


Then, if I move the 'static' keyword, like so:

1 char static __attribute__((weakref("LNU__strmats__LNU"))) strmats(char* s, char* m, int* l, unsigned int options) __attribute__((nonnull));
2 char* static __attribute__((weakref("LNU__strmat__LNU"))) strmat(char* s, char* m, int* l, unsigned int options) __attribute__((nonnull));


The 1st declaration still compiles, but the 2nd one fails like this:

error.c:1: error: expected identifier or '(' before 'static'

I am compiling on Linux

Linux Organization 2.6.22.19-24nssmp #1 SMP Thu Jan 21 21:13:10 UTC 2010 i686 pentium3 i386 GNU/Linux

with gcc (GCC for Cross-LFS 4.3.3.20090323) 4.3.3

Any workaround appreciated,

Thanks

-Todd


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