octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #43171] libgnu/stdio.h is included in an illeg


From: anonymous
Subject: [Octave-bug-tracker] [bug #43171] libgnu/stdio.h is included in an illegal way
Date: Mon, 08 Sep 2014 14:36:05 +0000
User-agent: Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.16

URL:
  <http://savannah.gnu.org/bugs/?43171>

                 Summary: libgnu/stdio.h is included in an illegal way
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Mon 08 Sep 2014 02:36:04 PM UTC
                Category: Configuration and Build System
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: Johannes Zarl
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

The file liboctave/cruft/misc/quit.h essentially includes stdio.h in the
following fashion:


extern "C" {
#include <stdio.h>
}


Inside libgnu/stdio.h, there are definitions for getchar et. al. inside a
namespace. All in all, the code amounts to something like the following:


extern "C" {
#include <stdio.h>
    namespace GNULIB_NAMESPACE
    {
        int (*getchar) (void) = ::getchar;
    }
}


This is ill-formed under the C++ standard section 7.5 (Paragraph 6), since
under C linkage the namespace is to be ignored for the resulting symbol name.

g++ currently does not throw an error on this code, but icpc does.

Moving the include statements outside of the extern "C" linkage block fixes
the issue.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43171>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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