6 msgShifting: what's going on?
1 msgneed help: gcc rtl function calls
7 msgHow to dump all the optimization flags enabled?
3 msgcommand line order of object files and libraries
5 msgOpenMP on gcc
1 msg[AIX] gcc cannot compile huge c file
2 msgSeemingly identical gcc versions, except one se...
4 msgwhat's this syntax ?
3 msgstrict C++ mode
2 msglist of warning messages
5 msgProblem With templates
4 msgEmbedded arm-elf-gcc
1 msgRe: bucknell matthews
1 msgCompiling gcc 3.3.2 on AIX 64 bit platform
2 msgcan __exchange_and_add be used from outside?
4 msgCommand flags for debugging template code
3 msg_ZTV vs _ZTI

'char *' diff in header & func arg list?
\ kourama (26 Mar 2007)
. \ John Love-Jensen (26 Mar 2007)
. . \ kourama (26 Mar 2007)

2 msgRe: Where is ld.so and libdl.so built from
2 msgmember class
Subject:'char *' diff in header & func arg list?
Group:Gcc-help
From:kourama
Date:26 Mar 2007



I have noticed something that seems wrong to me, and I'd like to know if
anyone can confirm the bug or explain the seemingly strange behaviour.
Attached is a set of files which demonstrates the problem:

http://www.nabble.com/file/7426/a.c a.c
http://www.nabble.com/file/7427/b.c b.c
http://www.nabble.com/file/7428/Makefile Makefile

When the aa function in a.c declares "char *arg" in it's argument list, it
gets a pointer, which means that "char *arg" is equivalent to "char arg[]"
in the argument list.

However, in the file b.c, the declaration "extern char *myarray" is treated
differently from "extern char myarray[]"

It seems to me that, based on the context, the two should be equivalent, but
GCC doesn't treat them that way.

So, is this a bug, legacy behaviour or is this just another wrinkle in the
sharpei puppy that is C?

Many thanks.
--
View this message in context: http://www.nabble.com/%22char-*%22-diff-in-header---func-arg-list--tf3468423.htm l#a9677694
Sent from the gcc - Help mailing list archive at Nabble.com.



© 2004-2008 readlist.com