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://www.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

Reply via email to