Date: Sun, 18 Dec 1994 21:07:28 +0300 (MSK) From: dima@demos.su (Dima Ruban) To: spaz@u.washington.edu (John Utz) Cc: FreeBSD-hackers@freefall.cdrom.com Subject: Re: any #define experts out there? Message-ID: <199412181807.VAA02195@deep-thought.demos.su> In-Reply-To: <Pine.OSF.3.91a.941216000248.2659A-100000@saul1.u.washington.edu> from "John Utz" at Dec 16, 94 00:05:13 am
next in thread | previous in thread | raw e-mail | index | archive | help
John Utz writes:
>
> HI folks;
>
> any reason why this define should crash gcc?
I did, but nothing wrong. Here goes logfile.
>
> #define NUMELEMS(ARRAY) sizeof(ARRAY)/sizeof(*ARRAY)
>
> suggestions are more then welcome...
[deep-thought]-pc:1> cat x.c
#define NUMELEMS(ARRAY) sizeof(ARRAY)/sizeof(*ARRAY)
main()
{
int foo[5];
printf("%d\n", NUMELEMS(foo));
}
[deep-thought]-pc:2> cc -O x.c
[deep-thought]-pc:3> ./a.out
5
[deep-thought]-pc:4> cc x.c
[deep-thought]-pc:5> ./a.out
5
[deep-thought]-pc:6> cc -v
gcc version 2.6.2
>
> *******************************************************************************
> John Utz spaz@stein.u.washington.edu
> idiocy is the impulse function in the convolution of life
>
>
-- dima
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199412181807.VAA02195>
