NetBSD Problem Report #51831

From dholland@netbsd.org  Wed Jan 11 19:06:08 2017
Return-Path: <dholland@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5F1217A28C
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 11 Jan 2017 19:06:08 +0000 (UTC)
Message-Id: <20170111190607.DE90F85851@mail.netbsd.org>
Date: Wed, 11 Jan 2017 19:06:07 +0000 (UTC)
From: dholland@NetBSD.org
Reply-To: dholland@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: ctype misuse no longer reported by gcc
X-Send-Pr-Version: 3.95

>Number:         51831
>Category:       toolchain
>Synopsis:       ctype misuse no longer reported by gcc
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 11 19:10:00 +0000 2017
>Closed-Date:    
>Last-Modified:  Mon Jun 04 19:05:00 +0000 2018
>Originator:     David A. Holland
>Release:        NetBSD 7.99.44 (20161208)
>Organization:
>Environment:
System: NetBSD macaran 7.99.44 NetBSD 7.99.44 (MACARAN) #40: Thu Dec  8 17:57:53 EST 2016  dholland@macaran:/usr/src/sys/arch/amd64/compile/MACARAN amd64
Architecture: x86_64
Machine: amd64
>Description:

Use of the <ctype.h> functions without casting to unsigned char no
longer triggers a warning in gcc. Not sure if this is because of gcc 5
or because of header changes; strings shows the warning is still in
/usr/libexec/cc1, and the current headers look like they should
trigger the warning (and do with a non-netbsd gcc 4.8.3 bin I had
lying around)... but they don't.

>How-To-Repeat:

Compile this with -Wall -W and note the absence of
foo.c:7:7: warning: array subscript has type 'char' [-Wchar-subscripts]
   ------
#include <ctype.h>

int foo(const char *s) {
   unsigned i;

   for (i=0; s[i]; i++) {
      if (isupper(s[i])) {
         return 1;
      }
   }
   return 0;
}
   ------

>Fix:

dunno.

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51831 CVS commit: src/share/mk
Date: Thu, 12 Jan 2017 11:47:18 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Thu Jan 12 16:47:18 UTC 2017

 Modified Files:
 	src/share/mk: bsd.sys.mk

 Log Message:
 PR/51831: Don't suppress warnings coming from system header macro expansions.


 To generate a diff of this commit:
 cvs rdiff -u -r1.264 -r1.265 src/share/mk/bsd.sys.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 04 Jun 2018 09:38:13 +0000
State-Changed-Why:
Is warning about this in the case of gcc and base bsd.sys.mk sufficient?


State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 04 Jun 2018 18:21:22 +0000
State-Changed-Why:
no :( most of these bugs occur in 3rd-party code
ideally we should switch the default behavior of -Wsystem-headers back,
or at least for certain warnings...


From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, toolchain-manager@netbsd.org, 
	netbsd-bugs@netbsd.org, gnats-admin@netbsd.org, dholland@NetBSD.org
Cc: 
Subject: Re: toolchain/51831 (ctype misuse no longer reported by gcc)
Date: Mon, 4 Jun 2018 14:29:29 -0400

 On Jun 4,  6:21pm, dholland@NetBSD.org (dholland@NetBSD.org) wrote:
 -- Subject: Re: toolchain/51831 (ctype misuse no longer reported by gcc)

 | Synopsis: ctype misuse no longer reported by gcc
 | 
 | State-Changed-From-To: feedback->open
 | State-Changed-By: dholland@NetBSD.org
 | State-Changed-When: Mon, 04 Jun 2018 18:21:22 +0000
 | State-Changed-Why:
 | no :( most of these bugs occur in 3rd-party code
 | ideally we should switch the default behavior of -Wsystem-headers back,
 | or at least for certain warnings...

 We have -Wsystem-headers in the base build... Is that for pkgsrc?

 christos

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/51831 (ctype misuse no longer reported by gcc)
Date: Mon, 4 Jun 2018 19:01:23 +0000

 On Mon, Jun 04, 2018 at 02:29:29PM -0400, Christos Zoulas wrote:
  > On Jun 4,  6:21pm, dholland@NetBSD.org (dholland@NetBSD.org) wrote:
  > -- Subject: Re: toolchain/51831 (ctype misuse no longer reported by gcc)
  > 
  > | Synopsis: ctype misuse no longer reported by gcc
  > | 
  > | State-Changed-From-To: feedback->open
  > | State-Changed-By: dholland@NetBSD.org
  > | State-Changed-When: Mon, 04 Jun 2018 18:21:22 +0000
  > | State-Changed-Why:
  > | no :( most of these bugs occur in 3rd-party code
  > | ideally we should switch the default behavior of -Wsystem-headers back,
  > | or at least for certain warnings...
  > 
  > We have -Wsystem-headers in the base build... Is that for pkgsrc?

 Ideally it should warn both in pkgsrc and when people compile random
 crap on their own. It won't occur to anyone to turn on
 -Wsystem-headers to help validate their own code.

 I don't suppose -Wsystem-headers supports -Wsystem-headers=foo like
 -Werror does?

 -- 
 David A. Holland
 dholland@netbsd.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.