Date: Tue, 21 Feb 2023 22:28:42 +0100 From: Markus Wichmann <nullplan@....net> To: musl@...ts.openwall.com Subject: Re: Re: [BUG] ioctl: overflow in implicit constant conversion On Tue, Feb 21, 2023 at 11:57:50AM -0500, Jeffrey Walton wrote: > In this case, I think the best course of action is to cast a,b,c to > unsigned, then perform the shifts, and finally cast back to int. That > is what the C standard requires. And it should not mess with the ABI. > Actually I messed up. That mostly happens already. The directions are defined as unsigned, and the conversion to int happens implicitly. So there is no undefined behavior. The compiler is merely warning about nothing. That also means the only thing missing to silence the warning would be a cast back to int. However, we have in the past never added code just to shut up overeager warnings. Should the compiler not suppress warnings that come from system headers? Ciao, Markus
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.