bugGNU Octave - Bugs: bug #46065, conflicting declarations of...


bug #46065: conflicting declarations of max_align_t since gnulib update

Submitter:  Carnë Draug <carandraug>
Submitted:  Mon 28 Sep 2015 12:12:01 PM UTC
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Tue 29 Mar 2016 05:00:12 PM UTC, comment #4: 

I think this is basically solved since we now compile with the latest standards options possible. Future versions of gcc and autoconf will also solve this by going to newer language standards by default.

Mike Miller <mtmiller>
Group Member
Tue 06 Oct 2015 12:10:46 AM UTC, comment #3: 

So what should we do here, should we try to detect something like this? Should we add a configure test to ensure something like C++ and C standards levels are compatible? I don't know how far we should take that.

Mike Miller <mtmiller>
Group Member
Mon 28 Sep 2015 02:48:27 PM UTC, comment #2: 

You are right. Also setting CFLAGS avoids the failure.

Carnë Draug <carandraug>
Group Member
Mon 28 Sep 2015 02:07:16 PM UTC, comment #1: 

Try adding CFLAGS='-std=gnu11' to your configure. If I read the gcc stddef.h correctly, it defines that type if either C++11 or C11 are in use. I guess that configure tries to find the type with the C compiler, not C++.

Mike Miller <mtmiller>
Group Member
Mon 28 Sep 2015 12:12:01 PM UTC, original submission:  

Back in Octave 3.8 it was possible to build Octave with C++11.  Now, it fails to build due to conflicting declarations of max_align_t by both gnulib and gcc:

make[3]: Entering directory '/home/carandraug/builds/octave/liboctave'
  CXX      array/array_libarray_la-Array-b.lo
In file included from /usr/include/c++/4.9/cstddef:45:0,
                 from /home/carandraug/dev/octave/liboctave/array/Array.h:30,
                 from /home/carandraug/dev/octave/liboctave/array/Array-b.cc:29:
../libgnu/stddef.h:93:3: error: conflicting declaration 'typedef union max_align_t max_align_t'
 } max_align_t;
In file included from ../libgnu/stddef.h:55:0,
                 from /usr/include/c++/4.9/cstddef:45,
                 from /home/carandraug/dev/octave/liboctave/array/Array.h:30,
                 from /home/carandraug/dev/octave/liboctave/array/Array-b.cc:29:
/usr/lib/gcc/x86_64-linux-gnu/4.9/include/stddef.h:425:3: note: previous declaration as 'typedef struct max_align_t max_align_t'
 } max_align_t;
Makefile:6887: recipe for target 'array/array_libarray_la-Array-b.lo' failed

The cause of the issue is our update of gnulib with cset 85d9cb769e8b.

I'm unsure if this bug is ours or gnulib but indeed, my config.log file has:


To reproduce, simply:

$ CXXFLAGS='-std=gnu++11 -g -O2' ~/dev/octave/configure && make

Carnë Draug <carandraug>
Group Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by carandraug (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-29 mtmiller StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code