Thread: Numerical digits as part of C function names and preprocessor macros

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    26

    Question Numerical digits as part of C function names and preprocessor macros

    Hi all,

    Is there any problem of having numerical digits as part of C function names and preprocessor macros?

    Could this practice lead me into incompatibilities among different compilers (i.e. some compilers/preprocessors may don't like this)?

    Thanks in advance.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    So long as it is a valid identifier (begins with an alpha), it should be fine.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by limp View Post
    Hi all,

    Is there any problem of having numerical digits as part of C function names and preprocessor macros?

    Could this practice lead me into incompatibilities among different compilers (i.e. some compilers/preprocessors may don't like this)?

    Thanks in advance.
    To expand on Salem's wisdom...

    AAA123 = valid.
    123AAA = syntax error.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 10-27-2009, 08:19 AM
  2. Using switch statements in function-like macros
    By robot_chicken in forum C Programming
    Replies: 3
    Last Post: 07-25-2009, 03:09 PM
  3. Order of execution of preprocessor macros
    By DL1 in forum C Programming
    Replies: 2
    Last Post: 04-02-2009, 06:52 PM
  4. function definition with macros
    By toshog in forum C++ Programming
    Replies: 2
    Last Post: 03-08-2009, 09:22 PM
  5. Replies: 8
    Last Post: 10-19-2003, 05:33 PM