On 04/10/2009, at 10:25 PM, Erik Olsson wrote:

Yes, it doesn't feel very safe that a character that the compiler doesn't
like isn't caught as an error at compile time. And that it in this case
meant that the statement always was evaluated to true must mean that "!="
with my CCSID (source file has 273 and target CCSID on the CRTCPPMOD was
*SOURCE) is interpreted as "==", which is kind of the last thing you want...
Confusing. Seems like I have more homework to do on the CCSIDs of source

When I looked at this yesterday I could have sworn the the ILE C reference materials stated that any source CCSID used must be compatible with CCSID 37 but, of course, I can't find that now.

Anyway, I compared the 273 to 37 conversion just out of curiosity and both show ! as x'5a' although they are at different offsets within the table. For 273 the offset is at x'5a', for 37 the offset is at x'4f'. What's interesting about that is that x'4f' in 273 is the vertical bar so perhaps your if-test is being interpreted as |= (i.e., bitwise-or assignment). If so then any non-zero result form the bitwise-or operation will be treated as true hence the body of the test is entered.

Don't you just love C's support for assignment within an if-test? Yet another example of why it's such a poor language for so many tasks!

Is all your source in 273 or only the main source file? Is your job also in 273 or something else?

I don't want to use trigraphs again. Yuck.

There isn't a trigraph for !=. You'd have to use the not_eq alternative token.

You may have better luck with source in CCSID 37 and specify TGTCCSID(273) on the compile command.

However, the ILE C reference manual suggests that at 610 they've added support for more input CCSIDs and since 273 isn't one of the problematic CCSIDs (290, 930, and 5026) I'd report the problem and see what they say.

Simon Coulter.
FlyByNight Software OS/400, i5/OS Technical Specialists

Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
ASCII Ribbon campaign against HTML E-Mail / \

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.