Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Sep 1996 12:10:59 -0600 (MDT)
From:      Brandon Gillespie <brandon@glacier.cold.org>
To:        freebsd-hackers@freebsd.org
Subject:   machine/endian.h: network byte order macros
Message-ID:  <Pine.BSF.3.91.960918120817.7911A-100000@glacier.cold.org>

next in thread | raw e-mail | index | archive | help
Compiling with '-Wall -pedantic' when using these macros (i.e. ntohs) 
gives the warning:

net.c: In function `get_server_socket':
net.c:129: warning: ANSI C forbids braced-groups within expressions
net.c: In function `io_event_wait':
net.c:249: warning: ANSI C forbids braced-groups within expressions
net.c: In function `non_blocking_connect':
net.c:317: warning: ANSI C forbids braced-groups within expressions

Although trivial, the problem can be fixed by just removing '(' ')' from 
the outside of the macro, leaving '{' '}' there.  This likely causes a 
problem with how its used (as a function), which would then lead one to 
think perhaps it should just be a function?  *shrug*

-Brandon Gillespie



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.960918120817.7911A-100000>