bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] stdalign: port better to MSVC and to Sun C 5.11


From: Bruno Haible
Subject: Re: [PATCH] stdalign: port better to MSVC and to Sun C 5.11
Date: Sun, 6 Nov 2011 21:55:48 +0100
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

Hi Paul,

> > 2) On Solaris 10 (both SPARC and i386) with cc, the test fails:
> > 
> > test-stdalign.c:81: assertion failed
> > FAIL: test-stdalign

Now it's at line 83.

> Yes, I can reproduce this, and it's already documented in
> stdalign.texi.  This is a bug in Sun C 5.11, which can occur when you
> declare lots of external variables with alignments, interleaved with
> typedefs and some other stuff.  GNU Emacs does not trigger the bug,
> and I imagine that the bug is not that likely in practice.  For now, I
> thought it best to document the bug and to have the test case fail if
> the bug is present.

Documenting the bug in doc/**/*.texi is good. But I don't like to have
the test fail, for two reasons:

  - It distracts my attention, each time I will see this test fail.
    Likewise, in packages that include the gnulib tests, it will cause
    bug reports to the maintainers of these packages, which will get
    forwarded to gnulib, just to get the answer "it's a known bug".

  - The gnulib tests are used as a reference, to understand what a
    gnulib module guarantees and what it doesn't guarantee. See e.g.
    tests/test-getlogin.c. Reader of the test's source code will be
    mistaken if they think the code is expected to succeed.

Here's a proposed patch. By the way, did you receive an URL we can include
in the comments here, meanwhile?


2011-11-06  Bruno Haible  <address@hidden>

        stdalign tests: Skip the test when compiled by Sun C.
        * tests/test-stdalign.c (main): Skip the test on Sun C.

--- tests/test-stdalign.c.orig  Sun Nov  6 21:52:14 2011
+++ tests/test-stdalign.c       Sun Nov  6 21:51:55 2011
@@ -80,6 +80,10 @@
 int
 main ()
 {
+#if defined __SUNPRO_C
+  fputs ("Skipping test: known Sun C compiler bug\n", stderr);
+  return 77;
+#else
   CHECK_ALIGNED (static_char_alignas);
   CHECK_ALIGNED (static_char_Alignas);
   CHECK_ALIGNED (static_short_alignas);
@@ -88,10 +92,10 @@
   CHECK_ALIGNED (static_int_Alignas);
   CHECK_ALIGNED (static_long_alignas);
   CHECK_ALIGNED (static_long_Alignas);
-#ifdef INT64_MAX
+# ifdef INT64_MAX
   CHECK_ALIGNED (static_int64_t_alignas);
   CHECK_ALIGNED (static_int64_t_Alignas);
-#endif
+# endif
   CHECK_ALIGNED (static_float_alignas);
   CHECK_ALIGNED (static_float_Alignas);
   CHECK_ALIGNED (static_double_alignas);
@@ -107,4 +111,5 @@
   CHECK_ALIGNED (static_struct4_alignas);
   CHECK_ALIGNED (static_struct4_Alignas);
   return 0;
+#endif
 }

-- 
In memoriam Louis Philippe d'Orléans 
<http://en.wikipedia.org/wiki/Louis_Philippe_II,_Duke_of_Orléans>



reply via email to

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