bug-gnulib
[Top][All Lists]
Advanced

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

Re: stdalign: new module


From: Bruno Haible
Subject: Re: stdalign: new module
Date: Fri, 28 Oct 2011 03:01:55 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

Hi Paul,

Thanks for this work!

Testing it on various platforms, I see the following problems:

1) On MSVC 9, I get syntax errors in test-stdalign.c:90, the
   reason being an extraneous level of parentheses in

      # define _Alignas(a) __declspec ((align (a)))

   Once this is fixed, I get syntax errors about the << operator.
   In fact, while MSVC accepts

      int __declspec (align (8)) foo;

   it rejects

      int __declspec (align (1 << 3)) foo;

   In other words, it wants only literals, not constant expressions.

   I'm not sure what is better: offering a macro that works only
   for literals, or defining a macro that gives no syntax error but
   does nothing.

2) The test calls abort() on several platforms:

   FreeBSD/x86 6.4
   Solaris 10 with cc (both SPARC and x86)
   mingw

3) The test causes a segmentation fault on:

   Cygwin 1.5.25.

Maybe it would be better to use the ASSERT macro, or simple
fprintf(stderr,...) calls, to get more information about the aborts?

Bruno
-- 
In memoriam Helmuth Hübener <http://en.wikipedia.org/wiki/Helmuth_Hübener>



reply via email to

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