public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* sizeof() function parameter array: known problem?
@ 2005-07-01  8:45 Etienne Lorrain
  2005-07-01  9:17 ` Andrew Haley
  2005-07-01  9:17 ` Jonathan Wakely
  0 siblings, 2 replies; 3+ messages in thread
From: Etienne Lorrain @ 2005-07-01  8:45 UTC (permalink / raw)
  To: gcc

  The result of this funtion is 1, is there a C lawyer around?

$ cat tmp.c
unsigned fct (unsigned array[10])
{
        return sizeof(array) / sizeof(array[0]);
}
$ gcc -v
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-java-awt=gtk
--host=i386-redhat-linux
Thread model: posix
gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)
$ gcc -S -o tmp.s tmp.c
$ cat tmp.s
        .file   "tmp.c"
        .text
.globl fct
        .type   fct, @function
fct:
        pushl   %ebp
        movl    %esp, %ebp
        movl    $1, %eax
        leave
        ret
        .size   fct, .-fct
        .section        .note.GNU-stack,"",@progbits
        .ident  "GCC: (GNU) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)"
$

  Etienne.


	

	
		
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-01  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-01  8:45 sizeof() function parameter array: known problem? Etienne Lorrain
2005-07-01  9:17 ` Andrew Haley
2005-07-01  9:17 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).