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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:39:51+00:00 2026-05-19T03:39:51+00:00

In discussing design possibilities for a project that has a very large number of

  • 0

In discussing design possibilities for a project that has a very large number of constants and bit patterns to be defined, the question came up about how many #defines can a standard compiler handle? I assume it is a very large number, but we were curious to know if there is an actual upper bound.

  • 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-19T03:39:51+00:00Added an answer on May 19, 2026 at 3:39 am

    For a “standard compiler”:

    5.2.4.1: “Translation limits”

    The implementation shall be able to
    translate and execute at least one
    program that contains at least one
    instance of every one of the following
    limits

    …

    4095 macro identifiers simultaneously
    defined in one preprocessing
    translation unit

    Note the slightly odd way of phrasing the requirement. Implementations could satisfy it by having a single “golden program” which they recognise and compile as a special case, although that would be akin to rigging benchmarks. In practice you can read the standard as saying that if your implementation imposes a limit other than available memory, then that limit should be at least 4095. Beyond 4095 you are relying on implementation-specific behavior to an extent.

    Some compilers (Microsoft) impose some implementation limits which are less than the standard says. These are listed somewhere on MSDN I think, but possibly only for C++. As far as C goes, since I’m quoting C99 it might not be relevant to MSVC anyway.

    For GCC and MSVC in particular, it shouldn’t be too hard to test whether a given implementation imposes an arbitrary limit, perhaps easier than finding it documented 🙂 Auto-generate files containing nothing but great long lists of #define, see what the preprocessor makes of them.

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

Sidebar

Related Questions

I am designing a system that should analyze large number of user transactions and
I was just discussing with some colleagues about Java constructors, design-patterns and good way
I just came out of a design meeting and had a question posed to
(not discussing the table design, its a done deal!) I know how to do
I'm discussing some software design issues with a potential client and the idea of
While discussing how to process AT commands with a colleague, we discovered that contrary
We've been discussing design of a data warehouse strategy within our group for meeting
In Bruce Tognazzini's quiz on Fitt's Law , the question discussing the bottleneck in
I was currently discussing with a few friends on how to design easily serializable
Greetings everyone, A friend and I are discussing the possibility of a new project:

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.