Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: glcorearb.h contains invalid code in C++

  1. #1
    Newbie Newbie
    Join Date
    Oct 2014
    Posts
    2

    glcorearb.h contains invalid code in C++

    In C++ it is illegal to include standard library headers inside an extern "C" context:

    [using.headers]p3: "A translation unit shall include a header only outside of any external declaration or definition, and shall include the header lexically before the first reference in that translation unit to any of the entities declared in that header. No diagnostic is required."
    Normally this error is not reported by the compiler and may not cause any other problems, and so it sneaks into codebases. However, with the clang compiler's support for modules being far enough along I tried flipping this compiler feature on for a small project, and under this mode the compiler does catch this error. I got these diagnostics:

    Code :
    glcorearb.h:616:1: error: import of C++ module 'Darwin.C.stddef' appears within extern "C" language linkage specification
    #include <stddef.h>
    ^
    glcorearb.h:5:1: note: extern "C" language linkage specification begins here
    extern "C" {
    ^
    glcorearb.h:1517:1: error: import of C++ module 'Darwin.C.inttypes' appears within extern "C" language linkage specification
    #include <inttypes.h>
    ^
    glcorearb.h:5:1: note: extern "C" language linkage specification begins here
    extern "C" {
    ^

    So my question is really, where can I report this error so that the official header, which platform vendors are not supposed to modify, can be fixed to comply with the C++ spec?

    You can find further discussion of the issue and modules on the compiler mailing list thread:

    lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039394.html

    (I'm not allowed to post links, so you'll just have to copy/paste)

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    878
    Sounds like a case for the khronos bugzilla, product "OpenGL" component "Registry" (?).

  3. #3
    Newbie Newbie
    Join Date
    Oct 2014
    Posts
    2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •