autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues w/ cross-compiling


From: Eric Blake
Subject: Re: Issues w/ cross-compiling
Date: Wed, 06 Aug 2008 07:19:51 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 7/8/2008 2:57 PM:
| This is odd.  I can confirm it though: bcc ("Bruce’s C compiler")
| doesn't throw a compile error for
|
| static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= 1)];
| test_array[0] = 0;

|
| I do get a compile error with
|
| int
| main ()
| {
| static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= 1)];
| return sizeof test_array;
|

|
| so I'm wondering whether we should change the test.  Changing
| AC_LANG_BOOL_COMPILE_TRY(C) in a way so that it doesn't ever
| warn (thus getting _AC_COMPUTE_INT_COMPILE to silently return
| bogus results), isn't completely trivial, though
| (unreachable code vs. code that is optimized away).

What about a combination of approaches?

static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= 1)];
return sizeof test_array - (test_array[0] = 0);

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkiZpPcACgkQ84KuGfSFAYCn3gCeKUVpdJlTQvlGEYOTYZoTK/KM
P+AAn0bLEtiv10ebEKJNg8An3wMUZglz
=3aM4
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]