On Wed, Aug 17, 2022 at 10:16:17AM +0300, Binyamin Dissen wrote:
> 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.  

Yes, in C single quotes are character (1 byte) constants.  Double
quotes are \0 terminated string of characters.

Some C compilers allow longer character constants if they fit
in an integer which is what is going on in your example.
 
> 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?

This isn't a hex constant, it's a character constant holding more than
1 character (in an int).

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

Reply via email to