Administrator
|
It looks like AbtCLangParser does not correctly handle nested #else directives. Everything inside the scope of a false valued #if is meant to be skipped. If that directive is the outermost, everything should be skipped.
-- Additionally, the set of used constant names missed one of the #defines (that shouldn't have been evaluated), even though the value is in the table. Set('ERROR1' 'ERROR2' 'FLG_AIXC' ) versus the table keys OrderedCollection('ERROR1' 'ERROR2' 'FLG_AIXC' 'ERROR3' ) To recreate, inspect the result of evaluating AbtCLangParser parseHFile: 'badsample.h'. The content of the file is shown below. The log on the Transcript shows when it decided to start including code. Info 2:C Interface Aid was started at 2:57:44 PM on badsample.h. Info 2013:CIA is not including code after #if was false. Info 2013:CIA is not including code after #if was false. Info 2013:CIA is not including code after #if was false. Info 2022:CIA encountered an #elif. Code is not being included. Info 2022:CIA encountered an #elif. Code is not being included. Info 2009:CIA encountered an #else. Code is being included. Warn 18:CIA could not parse the definition on line 18. The definition will be added to the object table as substitutable text. Info 2007:CIA has reached a #endif. Info 2013:CIA is not including code after #if was false. Info 2011:CIA is not including code after #ifndef _LP64 was false. Info 2007:CIA has reached a #endif. Info 2007:CIA has reached a #endif. Info 2011:CIA is not including code after #ifndef _ALL_SOURCE was false. Info 2007:CIA has reached a #endif. Info 2009:CIA encountered an #else. Code is being included. Warn 18:CIA could not parse the definition on line 37. The definition will be added to the object table as substitutable text. Info 2007:CIA has reached a #endif. Info 2013:CIA is not including code after #if was false. Info 2009:CIA encountered an #else. Code is being included. Info 2000:CIA added a preprocessor definition for FLG_AIXC. Warn 18:CIA could not parse the definition on line 45. The definition will be added to the object table as substitutable text. Info 2007:CIA has reached a #endif. Info 2013:CIA is not including code after #if was false. Info 2007:CIA has reached a #endif. Info 2007:CIA has reached a #endif. Info 3:C Interface Aid ended at 2:57:44 PM on badsample.h. ============== badsample.h ==================== #if defined(AIX) || defined(_AIX) /* Rios changes 11 dec 89 , _AIX appears to be for AIX v3 on the early HW */ /*======================================================================== * * IBM AIX * *======================================================================== */ #if defined (_IBMR2) #define FLG_IBM_RIOS #if FLG_AIX_VERSION == 53 #define FLG_MACHINE_OS "RISC 6000 (AIX 5.3)" #elif FLG_AIX_VERSION == 61 #define FLG_MACHINE_OS "RISC 6000 (AIX 6.1)" #elif FLG_AIX_VERSION == 71 #define FLG_MACHINE_OS "RISC 6000 (AIX 7.1)" #else #define ERROR1 This is wrong - it is three levels deep in false valued if directives and should not evaluate #endif #define FLG_VER_MACHINE_ARCH "RISC 6000" #define FLG_VER_OS_NAME "AIX" #define _XOPEN_SOURCE_EXTENDED 1 #if defined(__64BIT__) #ifndef _LP64 #define _LP64 1 #endif #endif #ifndef _ALL_SOURCE #define _ALL_SOURCE 1 #endif #define _BSD TRUE /* needed for union wait definition */ #define FLG_64BIT_CPU TRUE #else #define ERROR2 This is wrong - it is inside a false valued if directive and should not evaluate #endif #if defined(__GNUC__) #define FLG_GNUC TRUE /* Gnu C */ #else #define FLG_AIXC TRUE /* AIX C compiler */ #define ERROR3 This is wrong - it is inside a false valued if directive and should not evaluate #endif /* __GNUC__ */ #define FLG_AIX_UNIX TRUE /* AIX Unix operating system */ #define FLG_UNIX TRUE /* we are working around FLG_OLD_MMAP with mmap / msync */ #if defined (CPP_AIX) #define FLG_AIX_CXX TRUE /* xlC compiler */ #endif #define FLG_CPU_POWERPC TRUE #endif You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/groups/opt_out. |
Administrator
|
It appears the following changes may correct the problem. The #else directive handling failed to check whether it was inside an also false block. Instead it was just using the opposite of its own #if directive.
-- else: aRhs "Private - A #else has been reached in the input file" | top answer | (condExecution isEmpty) ifFalse: [top := condExecution removeFirst.] ifTrue: [ infoHandler error: 2015. top := false. ]. (top isNil) ifFalse: [ answer := top not and: [condExecution first]. condExecution addFirst: answer. (answer) ifTrue:[ infoHandler info: 2009 with: 'is'] ifFalse: [infoHandler info: 2009 with: 'is not']. ] ifTrue: [condExecution addFirst: nil]. ^ answer On Wednesday, November 13, 2013 3:03:16 PM UTC-8, Richard Sargent wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/groups/opt_out. |
On Wednesday, November 13, 2013 6:30:53 PM UTC-5, Richard Sargent wrote:
--
If I'm reading your suggested changes correctly, looks like it's possible for #else: to answer true, false or nil. Is this really what you had in mind or does the execution path prevent this? If it does, then perhaps the method wants re-writing to clarify this. Of course, it's also possible nobody cares about the result, but in that case why even bother answering anything? Tom You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/groups/opt_out. |
Administrator
|
On Wednesday, November 13, 2013 6:44:06 PM UTC-8, Thomas Koschate wrote:
--
The return value set is unchanged. Yes, it can answer true, false, or nil. No, I have no idea why it was done that way. You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/groups/opt_out. |
created case 53133
-- On Thursday, November 14, 2013 12:50:40 PM UTC-5, Richard Sargent wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/groups/opt_out. |
Free forum by Nabble | Edit this page |