From owner-freebsd-current@FreeBSD.ORG Tue Nov 1 01:35:12 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60FD21065718 for ; Tue, 1 Nov 2011 01:35:12 +0000 (UTC) (envelope-from loox@e-shell.net) Received: from mail.serpronet.com (mail.serpronet.com [64.214.84.187]) by mx1.freebsd.org (Postfix) with ESMTP id 44FB08FC0C for ; Tue, 1 Nov 2011 01:35:07 +0000 (UTC) Received: by titan.serpronet.com (Postfix, from userid 506) id DB3BBC4C3B; Mon, 31 Oct 2011 18:35:37 -0600 (CST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on titan.serpronet.com X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.5 Received: from twinmoon.e-shell.net (unknown [10.1.10.180]) by titan.serpronet.com (Postfix) with ESMTP id 325E0C4C30 for ; Mon, 31 Oct 2011 18:35:35 -0600 (CST) Received: from moonlight.e-shell.tk (unknown [189.247.245.165]) by twinmoon.e-shell.net (Postfix) with ESMTPSA id 99D4D17025 for ; Mon, 31 Oct 2011 18:36:55 -0600 (CST) From: Axel Gonzalez To: freebsd-current@freebsd.org Date: Mon, 31 Oct 2011 18:35:18 -0600 Message-ID: <1562351.Ln9lEKl2rv@moonlight.e-shell.tk> User-Agent: KMail/4.7.1 (FreeBSD/9.0-RC1; KDE/4.7.2; i386; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Strange warning with clang and 9RC1 (ntohs) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 01:35:12 -0000 I'm getting an strange warning whem compiling with clang (from base) on RC1. This warning doesn't appear with 8.X and clang from ports. The warning is strange because ntohs is not int: uint16_t ntohs(uint16_t netshort); Any insight would be appreciated, thanks in advance! A **** % gcc -Wall -o ntohs ntohs.c % clang -Wall -o ntohs ntohs.c ntohs.c:8:12: warning: conversion specifies type 'unsigned short' but the argument has type 'int' [-Wformat] printf("%hu\n", ntohs(x)); ~~^ ~~~~~~~~ %d 1 warning generated. #include #include int main() { uint16_t x = htons(80); printf("%hu\n", (uint16_t)ntohs(x)); printf("%hu\n", ntohs(x)); return (0); } -- Mon Oct 31 18:02:13 2011 GMT ** **** ***** ****** ****** ***** **** ** 5.