Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8151013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:14:10+00:00 2026-06-06T15:14:10+00:00

My C++ compiler cannot understand the restrict directive. How do I suppress these errors?

  • 0

My C++ compiler cannot understand the restrict directive.

How do I suppress these errors?

/usr/include/inttypes.h:271: error: expected ',' or '...' before 'nptr'

usr/include/inttypes.h contains

extern intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base);

Compile command:

g++ -c -pipe -g -gdwarf-2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall
-W -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-DPIC -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -o player.o ../dir/player.cpp

Edit:

$ g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:14:12+00:00Added an answer on June 6, 2026 at 3:14 pm

    G++ doesn’t support the restrict keyword, which is valid in C but not C++.

    It does support __restrict__ as an extension, so you could compile with -Drestrict=__restrict__ to use the preprocessor to turn it into the accepted keyword.

    See http://gcc.gnu.org/onlinedocs/gcc/Restricted-Pointers.html for details.

    The issue seems to be caused by your use of -DISOC99_SOURCE which doesn’t seem to be compatible with C++ on your OS, since it enables C99 features that are not valid in C++. On GNU/Linux I would suggest using -D_GNU_SOURCE instead, but I doubt that works on Mac OS X.

    So instead of -Drestrict=__restrict__ you could just stop using -D_ISOC99_SOURCE — why do you even need that for C++?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically it is the following code, which cannot pass compiler (g++) #include <boost/program_options.hpp> #include
For the life of me I cannot understand why the compiler won't let me
I cannot understand why my compiler (MSVC++2010) doesn't like this code: // get_sum(filename as
I'm running into some compiler errors I don't understand. I'm pretty sure I'm doing
For reasons that I cannot completely understand, Cmake awlays chooses the GNU compiler toolset
A compiler cannot eliminate or reorder reads/writes to a volatile -qualified variables. But what
I am working on a platform with a gcc compiler however boost cannot compile
I have only this, but my compiler says:Type mismatch: cannot convert from ArrayList to
The following [c#] code will not compile with the error operator == cannot be
The following code throws an compile-time error like Cannot convert type 'string' to 'int'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.