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

  • Home
  • SEARCH
  • 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 6378941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:04:28+00:00 2026-05-25T02:04:28+00:00

Is it possible to issue a case insensitive #define statement with the preprocessor? For

  • 0

Is it possible to issue a case insensitive #define statement with the preprocessor?

For example, I want to convert any casing of foobar to spameggs, i.e.:

FooBar -> spameggs
foobar -> spameggs
fooBar -> spameggs
Foobar -> spameggs
FOOBAR -> spameggs
FOOBAr -> spameggs (an odd possibility I know)
etc

The reason behind this is that I want to #define some fortran subroutines to have different names, and they of course are case insensitive. Please note that I don’t really care about preserving the capitalisation scheme (which in the last example seems kinda nonsense).

  • 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-25T02:04:29+00:00Added an answer on May 25, 2026 at 2:04 am

    Alas, as you know, C identifiers are case sensitive. Hence, so are pre-processor symbols (if one were case sensitive and the other were not, you could get some very strange behaviours when you intended to alter just one of the symbols with the preprocessor). There isn’t an override flag for this behaviour, nor an alternative define construct (at least that I’m aware of in GCC compiler front-ends for C/++).

    The most obvious solution will be to grep your code for foobar, case insensitively. Use the results to build a table of all possible foobar casings and either

    1. Correct them all to one consistent casing
    2. Create a single pre-processor file that does the redefinitions for all the cases.

    In the later solution, you needn’t pollute some human readable code with this – just machine generate a FixFooBar.h file full of these remappings, and include it where needed.

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

Sidebar

Related Questions

It's an important security issue and I'm sure this should be possible. A simple
Okay, of course it is possible, that's no issue. In my code I have
Possible Duplicate: Renaming Directory with same name different case I appear to be running
In scala it is possible to define a local block in a function. The
Is there any issue with partially overriding a set of virtual functions defined by
Is it possible to configure Jersey via XML rather than annotations? Here's my issue:
Is it possible to log CREATE / ALTER statements issued on a MySQL server
Im having issues getting this to work, maybe its not even possible? I have
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the

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.