helpGNU gperf perfect hash fn generator - Support: sr #106698, Use of C preprocessor to validate...

 
 

sr #106698: Use of C preprocessor to validate character values as ASCII

Submitted by:  None
Submitted on:  Fri 27 Mar 2009 04:19:42 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Operating System: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 27 Mar 2009 04:19:42 PM UTC, original submission:

I'm using gperf on AIX 5.3 with the IBM xlC compiler. In version 7 and 8 of xlC the preprocessor does not assign the value of 39 to '\'' and 92 to '\\'. The version 7 compiler did. This results in compilation failures because gperf generates a #if stanza that checks each character literal against its ASCII value, and issues a #error if there is a mismatch.

While this is likely a compiler problem, I checked the 1998 ANSI C++ standard and it states in section 16.1.4 that the numeric values of character literals used during preprocessor expression evaluation do not have to match the values used outside the preprocessor. So I think it think it may be a good idea to add an option to disable this check, or something during configuration that checks for preprocessors with this behavior, or to perhaps do this check some other way.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup