Commit d6ed95fc by Trevor Saunders Committed by Trevor Saunders

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  <tbsaunde+gcc@tbsaunde.org>

	* configure: Regenerate.

config/ChangeLog:

2015-05-04  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* bitfields.m4: Change int to long long, and use bitfields of
	width 1 instead of 0.

From-SVN: r222794
parent f6341d8d
2015-05-04 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* bitfields.m4: Change int to long long, and use bitfields of
width 1 instead of 0.
2015-05-01 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> 2015-05-01 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* bitfields.m4: New file. * bitfields.m4: New file.
......
...@@ -13,10 +13,9 @@ AC_DEFUN([gt_BITFIELD_TYPE_MATTERS], ...@@ -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_CACHE_CHECK([if the type of bitfields matters], gt_cv_bitfield_type_matters,
[ [
AC_TRY_COMPILE( AC_TRY_COMPILE(
[struct foo1 { char x; char :0; char y; }; [struct foo1 { char x; char y:1; char z; };
struct foo2 { char x; int :0; char y; }; struct foo2 { char x; long long int y:1; char z; };
int foo1test[ sizeof (struct foo1) == 2 ? 1 : -1 ]; int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 1 : -1 ]; ],
int foo2test[ sizeof (struct foo2) == 5 ? 1 : -1]; ],
[], gt_cv_bitfield_type_matters=yes, gt_cv_bitfield_type_matters=no) [], gt_cv_bitfield_type_matters=yes, gt_cv_bitfield_type_matters=no)
]) ])
if test $gt_cv_bitfield_type_matters = yes; then if test $gt_cv_bitfield_type_matters = yes; then
......
2015-05-04 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* configure: Regenerate.
2015-05-01 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> 2015-05-01 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* acinclude.m4: Include bitfields.m4. * acinclude.m4: Include bitfields.m4.
......
...@@ -11539,10 +11539,9 @@ else ...@@ -11539,10 +11539,9 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
struct foo1 { char x; char :0; char y; }; struct foo1 { char x; char y:1; char z; };
struct foo2 { char x; int :0; char y; }; struct foo2 { char x; long long int y:1; char z; };
int foo1test[ sizeof (struct foo1) == 2 ? 1 : -1 ]; int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 1 : -1 ];
int foo2test[ sizeof (struct foo2) == 5 ? 1 : -1];
int int
main () main ()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment