Unlike PL/I, C treats characters and strings differently. C uses apostrophes 
for character constants, which are limited to single characters, either 
explicitly or due to a backslash (\) escape sequence. IMHO the message should 
be an error, not a warning.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Binyamin Dissen [[email protected]]
Sent: Wednesday, August 17, 2022 3:16 AM
To: [email protected]
Subject: C compile: INFORMATIONAL CCN4118 **name** C F1:2008  Character 
constant 'xF0' has more than 1 character.

I have inherited some C code.

  str2 = str2 ¦ 'xF0';
  str1 = str1 >> 4;
  str1 = str1 ¦ 'xF0';

These receive

CCN4118 Character constant 'xF0' has more than 1 character.

Examining the source4 it appears the intent is for 0xF0

1. Why would this be a mere informational message? Seems like it should be a
warning. that the sizes do not match.

The code generated is


*    str2 = str2 ¦ 'xF0';
          SLR      r0,r0
          IC       r0,str2(,r13,157)
          O        r0,=F'10995440'
          N        r0,=F'255'
          STC      r0,str2(,r13,157)
*    str1 = str1 >> 4;
          SLR      r0,r0
          IC       r0,str1(,r13,156)
          SRA      r0,4
          N        r0,=F'255'
          STC      r0,str1(,r13,156)
*    str1 = str1 ¦ 'xF0';
          SLR      r0,r0
          IC       r0,str1(,r13,156)
          O        r0,=F'10995440'
          N        r0,=F'255'
          STC      r0,str1(,r13,156)

10995440 = x'A7C6F0' = 'xF0'

2. This is very old cold, not compiled for years (decades?). Was there a point
in C compiler history where 'this was ever a valid hex constant?

--
Binyamin Dissen <[email protected]>
http://secure-web.cisco.com/1migAFmtAPN_23mBVeDiu-PcLHoaTptHEV1bWf0n3YrzyB1Uy0SXsBP1uzTX8wSAn4-DPZUsU-_qzT8SbayVXo2EZbCir2Tfx9QeOzjyGxw_g_KYhh7gbCn9B3jeArTzhOtHhMNrYEpB00xRSITNW4msCg3wNr1t0GBMc6ETzt-Rq9aaeg5dp3w0jKXB-WQDy0wImP9zMKRnbxDTa-a3NuFXz-lsDTyVM0EtRRHfFq2VooTQgwfmXKxfcsbSqllRPwI0mX6J2FC7gIcbfAZwSk_dITnjwfrhd_tqE273ycjKnTZg4IEqxV538L06VI4j2BGTO1cT6sxnx88x9prTlyu5FDdfABUBUWFmVFb4ZfNMovnEE60CO7fspZO085ot9gRHJ_JXl_jZfujp1eJgqw7wOdYXTwAdbeb4zk8McOOtT7XeUIkpuoeMyUVFkkmvxfMGFwN9gT_m-VzpP-UA-Jw/http%3A%2F%2Fwww.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to