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 6890259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:15:34+00:00 2026-05-27T06:15:34+00:00

In a makefile I work on, gcc is used with the -D XOPEN_SOURCE=500 and

  • 0

In a makefile I work on, gcc is used with the -D XOPEN_SOURCE=500 and -D_BSD_SOURCE options. gcc --help does not tell me what these are; a quick google search didn’t help either. I’m quite a newbie with gcc, could someone give me a hint?

  • 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-05-27T06:15:34+00:00Added an answer on May 27, 2026 at 6:15 am

    According to the GCC documentation (“3.11 Options Controlling the Preprocessor”), the -D switch defines the macros XOPEN_SOURCE and _BSD_SOURCE with the values 500 and 1 respectively. It’s as though you have this code at the beginning of all the source files you pass to GCC:

    #define XOPEN_SOURCE 500
    #define _BSD_SOURCE 1
    

    Build scripts usually take advantage of the compiler’s ability to “insert” macros like these to “communicate” to the source code details about the platform being targeted (e.g. operating system version).

    The “opposite” command-line switch for -D is -U, which #undefs a macro.

    Most (if not all) modern C/C++ compilers include similar switches. For example, Visual C++ compilers accept the /D compiler switch, which essentially serves the same purpose as GCC’s -D switch.


    For future reference, the GCC option index is great if you need to look up compiler switches for the GCC compiler.

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

Sidebar

Related Questions

At work we use a common makefile that other makefiles include (via the include
Instructions in the blinky.zip , gcc-section, Teensy++ v.2. Makefile and blinky.c are in the
I want to write a (gmake) makefile for a compiler that - unlike gcc
I'm trying to specify rpath in my binary. My makefile looks like this- CC=gcc
So I'm having trouble getting even a simple Makefile to work. Heres what I
My makefile: ifndef VEC_LEN VEC_LEN = 1 endif my_target: a.c gcc a.c -DVEC_LEN=$(VEC_LEN) Is
Hey guys I wrote a makefile which work perfectly fine on my 27 iMac
Is makefile an advanced problem or a general problem for a programmer? For a
I have a Makefile building many C files with long long command lines and
I have a makefile template to compile a single DLL (for a plugin system).

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.