[Top][All Lists]

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

test-stdalign.c fails to compile on i686

From: Jim Meyering
Subject: test-stdalign.c fails to compile on i686
Date: Sun, 18 Oct 2015 18:32:29 -0700

Hi Paul,

Preparing for the release of grep-2.22, I ran its tests on an
old i686 system with gcc-4.7.2 and other fedora-18-era tools,
that triggered the failure of this static assertion in test-stdalign.c:

  CHECK_STATIC (int64_t);

That arises because this "verify" expression is false:

  #define CHECK_STATIC(type) \
    typedef struct { char slot1; type slot2; } type##_helper; \
    verify (alignof (type) == offsetof (type##_helper, slot2)); \

The actual values are 8 and 4.
Here's a mostly-stand-alone test case:

#include <stdalign.h>
#include "verify.h"
main ()
  typedef struct { char slot1; double slot2; } XX;
  verify (alignof(double) == offsetof (XX, slot2));
  return 0;

$ gcc -std=gnu11 -I../lib test-stdalign.c
test-stdalign.c: In function 'main':
test-stdalign.c:8:3: error: static assertion failed: "verify
(alignof(double) == offsetof (XX, slot2))"

The same problem appears to affect the double-related tests.

Testing on i686 at all was mostly on a whim.
This is not a release blocker, by a long shot.

reply via email to

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