NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/53618: bogus warnings from printf %u and ntohs with -O1



The following reply was made to PR toolchain/53618; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: toolchain/53618: bogus warnings from printf %u and ntohs with -O1
Date: Wed, 19 Sep 2018 09:47:10 +0200

 This is how it traditionally worked. It does not even depend on
 optimization level, on big endian CPUs all ntoh* are no-ops.
 
 Our documentation gives a small hint:
 
      On machines which have a byte order which is the same as the network
      order, these routines are defined as macros that expand to the value of
      their argument.
 
 So you better store the value in an uint16_t if you need to rely on
 exact type.
 
 Martin
 


Home | Main Index | Thread Index | Old Index