Subject: misc/6185: Warning when using ntohs() and friends
To: None <gnats-bugs@gnats.netbsd.org>
From: Peter Simons <simons@peti.gmd.de>
List: netbsd-bugs
Date: 09/21/1998 13:08:38
>Number:         6185
>Category:       misc
>Synopsis:       Warning when using ntohs() and friends
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 21 04:20:00 1998
>Last-Modified:
>Originator:     Peter Simons
>Organization:
	
>Release:        NetBSD/i386 1.3
>Environment:
	
System: NetBSD peti.gmd.de 1.3 NetBSD 1.3 (PETI) #1: Wed Feb 11 13:59:52 CET 1998 simons@peti.gmd.de:/usr/src/sys/arch/i386/compile/PETI i386

>Description:

Compiling the program

     #include <sys/types.h>

     int main()
     {
	 int i = ntohs(htons(0));
	 return i;
     }

with egcs 1.1 will give the following warnings:

 | simons@peti:/tmp$ gcc -ansi -pedantic test.c -o test
 | test.cpp: In function `int main()':
 | test.cpp:5: warning: ANSI C++ forbids braced-groups within expressions
 | test.cpp:5: warning: ANSI C++ forbids braced-groups within expressions

>How-To-Repeat:
	
>Fix:
	
>Audit-Trail:
>Unformatted: