URL:
  <https://savannah.gnu.org/support/?111380>

                 Summary: autoconf-2.72.90 C vs C++ test failure with Oracle
Studio 12.6
                   Group: Autoconf
               Submitter: eggert
               Submitted: Tue 03 Feb 2026 07:39:06 PM PST
                Priority: 5 - Unprioritized
                Severity: 2 - Minor
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Unlocked
        Operating System: Solaris


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 03 Feb 2026 07:39:06 PM PST By: Paul Eggert <eggert>
I tested autoconf-2.72.90 on Solaris 10 sparc and Oracle Studio 12.6 (Sun
C/C++ 5.15) after building and installing GNU m4 1.4.19 myself, but without
using any other GNU software. Test 324 (AC_C_FLEXIBLE_ARRAY_MEMBER) failed
with hard-to-decipher diagnostics. As near as I can make out, the following
test program is related to what makes the test case go haywire:

  #include <stdlib.h>
  #include <stdio.h>
  #include <stddef.h>
  struct s { int n; double d[]; };
  int
  main (void)
  {
    int m = getchar ();
    struct s *p = (struct s *) malloc (offsetof (struct s, d)
                                       + m * sizeof (double));
    p->d[0] = 0.0;
    m = p->d != (double *) NULL;
    free (p);
    return m;
  }

If you compile this program with 'cc -S t.c' everything works; but if you
compile it with 'CC -S t.c' it fails with the diagnostic:

"t.c", line 4: Error: In this declaration "d" is of an incomplete type
"double[]".

This causes AC_C_FLEXIBLE_ARRAY_MEMBER to act differently depending on whether
you use C or C++, which causes test/acc.at's
AT_CHECK_MACRO([AC_C_FLEXIBLE_ARRAY_MEMBER]) to fail because AT_CHECK_MACRO
insists that the C compiler behave like the C++ compiler.

I don't know why AT_CHECK_MACRO insists that C++ behave like C. But perhaps
the testing regime shouldn't be calling
AT_CHECK_MACRO([AC_C_FLEXIBLE_ARRAY_MEMBER]), to avoid what appears to be a
false positive.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?111380>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to