From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19732 invoked by alias); 13 Feb 2008 16:04:54 -0000 Received: (qmail 19724 invoked by uid 22791); 13 Feb 2008 16:04:53 -0000 X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.31) with SMTP; Wed, 13 Feb 2008 16:04:33 +0000 Received: (qmail 29195 invoked by uid 0); 13 Feb 2008 16:04:31 -0000 Received: from 195.37.62.87 by www080.gmx.net with HTTP; Wed, 13 Feb 2008 17:04:31 +0100 (CET) Content-Type: text/plain; charset="us-ascii" Date: Wed, 13 Feb 2008 16:04:00 -0000 From: "Rene Perlberg" Message-ID: <20080213160431.145850@gmx.net> MIME-Version: 1.0 Subject: Warning when passing int, but unsigned int is awaited? To: gcc-help@gcc.gnu.org X-Authenticated: #5077615 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) Content-Transfer-Encoding: 7bit X-GMX-UID: YXjRE74YbXB+aAoIfzQ2AXMiLyUmZcjU X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-02/txt/msg00123.txt.bz2 Hello everyone, following scenario: void func(unsigned int _u) { //do a lot of stuff } int main() { int i = -1; func(i); return 0; } Is there any way to make the compiler write a warning or an error, when an int is passed to a function which awaits an unsigned int? I tried some of the options gcc gives the user, but nothing worked for me. I'm using gcc, version 4.1.3 20070929. Best regards. -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser