Avoid generating C trigraphs
|Reported by:||duncan||Owned by:||kchugalinskiy|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
Description (last modified by thomie)
main = print "??)"
If we compile the above with an unregisterised ghc then some gcc versions report:
/tmp/ghc6084_0/ghc6084_0.hc:99:30: warning: trigraph ??) ignored, use -trigraphs to enable
This should make us nervous.
According to the GCC manual if we were ever to use -std=c89 or any of the official C standard compliance modes (ie non-GNU) then we would get standard C (cpp) trigraph behavior.
We should therefore add a codeGen/should_run test to make sure that the above program does always print "??)" and never "]". This test only needs to be run in unregisterised mode.
It's not an immediate priority but it may trip someone up in future when porting or if we make unregisterised C code more standards compliant and start using one of the official -std= modes. It is unlikely to hit us but if it ever did it'd be a real pain to debug.
Change History (20)
comment:3 follow-up: ↓ 4 Changed 7 years ago by igloo
- Milestone set to 6.12 branch
- Owner igloo deleted
comment:6 Changed 6 years ago by igloo
- Milestone changed from 6.12.1 to 6.12 branch
- Type of failure set to None/Unknown
comment:8 Changed 6 years ago by igloo
- Milestone changed from 6.12.3 to 6.14.1
- Priority changed from normal to low
comment:13 Changed 4 years ago by igloo
- Milestone changed from 7.4.1 to 7.6.1
- Priority changed from low to lowest
comment:16 Changed 18 months ago by thomie
- Description modified (diff)
- Keywords unregisterised added
- Summary changed from add test for C trigraphs to Avoid generating C trigraphs