From: Trevor Saunders Date: Tue, 5 May 2015 03:41:53 +0000 (+0000) Subject: Improve the test in bitfields.m4 X-Git-Tag: basepoints/gcc-7~7393 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d6ed95fcb59511ef219b33cdee5895fce44ea45a;p=thirdparty%2Fgcc.git Improve the test in bitfields.m4 Using a named bitfield with a width more than 0 means we won't hit weirdness caused by the bitfield not really needing to exist. Changing int to long long means we won't have trouble with some arch where size of int is 1 or 2. libobjc/ChangeLog: 2015-05-04 Trevor Saunders * configure: Regenerate. config/ChangeLog: 2015-05-04 Trevor Saunders * bitfields.m4: Change int to long long, and use bitfields of width 1 instead of 0. From-SVN: r222794 --- diff --git a/config/ChangeLog b/config/ChangeLog index 19f2103a3c09..d62ae4ce6c87 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2015-05-04 Trevor Saunders + + * bitfields.m4: Change int to long long, and use bitfields of + width 1 instead of 0. + 2015-05-01 Trevor Saunders * bitfields.m4: New file. diff --git a/config/bitfields.m4 b/config/bitfields.m4 index ee8f3b5baba0..8185cd302a9c 100644 --- a/config/bitfields.m4 +++ b/config/bitfields.m4 @@ -13,10 +13,9 @@ AC_DEFUN([gt_BITFIELD_TYPE_MATTERS], AC_CACHE_CHECK([if the type of bitfields matters], gt_cv_bitfield_type_matters, [ AC_TRY_COMPILE( - [struct foo1 { char x; char :0; char y; }; -struct foo2 { char x; int :0; char y; }; -int foo1test[ sizeof (struct foo1) == 2 ? 1 : -1 ]; -int foo2test[ sizeof (struct foo2) == 5 ? 1 : -1]; ], + [struct foo1 { char x; char y:1; char z; }; +struct foo2 { char x; long long int y:1; char z; }; +int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 1 : -1 ]; ], [], gt_cv_bitfield_type_matters=yes, gt_cv_bitfield_type_matters=no) ]) if test $gt_cv_bitfield_type_matters = yes; then diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index 5137f21c9c50..d70808417ef7 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,7 @@ +2015-05-04 Trevor Saunders + + * configure: Regenerate. + 2015-05-01 Trevor Saunders * acinclude.m4: Include bitfields.m4. diff --git a/libobjc/configure b/libobjc/configure index 0547f913a6b9..2f71735f2552 100755 --- a/libobjc/configure +++ b/libobjc/configure @@ -11539,10 +11539,9 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -struct foo1 { char x; char :0; char y; }; -struct foo2 { char x; int :0; char y; }; -int foo1test[ sizeof (struct foo1) == 2 ? 1 : -1 ]; -int foo2test[ sizeof (struct foo2) == 5 ? 1 : -1]; +struct foo1 { char x; char y:1; char z; }; +struct foo2 { char x; long long int y:1; char z; }; +int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 1 : -1 ]; int main () {