mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyle Moffett <mrmacman_g4@mac.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Paulo Marques <pmarques@grupopie.com>,
	akpm@osdl.org, Shankar Unni <shankarunni@netscape.net>,
	linux-kernel@vger.kernel.org, bunk@stusta.de, khali@linux-fr.org
Subject: Re: Not a GCC bug (was Re: Big GCC bug!!! [Was: Re: Do not misuse Coverity please])
Date: Wed, 30 Mar 2005 19:58:01 -0500	[thread overview]
Message-ID: <e8fc51864bab0a24b04af9867d748f5f@mac.com> (raw)
In-Reply-To: <20050330233825.GS17420@devserv.devel.redhat.com>

On Mar 30, 2005, at 18:38, Jakub Jelinek wrote:
> This testcase violates ISO C99 6.3.2.3:
> If a null pointer constant is converted to a pointer type, the 
> resulting
> pointer, called a null pointer, is guaranteed to compare unequal to a
> pointer to any object or function.

Except that the result of dereferencing a null pointer is implementation
defined according to the C99 standard.  My implementation allows me to 
mmap
stuff at NULL, and therefore its compiler should be able to handle that
case.  I would have no problem with either the standard or 
implementation
if it either properly handled the case or didn't allow it in the first
place.

On another note, I've discovered the flag 
"-fno-delete-null-pointer-checks",
which should probably be included in the kernel makefiles to disable 
that
optimization for the kernel.  (Ok, yes, I apologize, this isn't really 
a GCC
bug, the behavior is documented, although it can be quite confusing.  I
suspect it may bite some platform-specific code someday.  It also 
muddies
the waters somewhat with respect to the original note (and the effects 
on
the generated code):

> int x = my_struct->the_x;
> if (!my_struct) return;

Cheers,
Kyle Moffett

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/CS/IT/U d- s++: a18 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$
L++++(+++) E W++(+) N+++(++) o? K? w--- O? M++ V? PS+() PE+(-) Y+
PGP+++ t+(+++) 5 X R? tv-(--) b++++(++) DI+ D+ G e->++++$ h!*()>++$ r  
!y?(-)
------END GEEK CODE BLOCK------



  reply	other threads:[~2005-03-31  0:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-27 20:50 [2.6 patch] sound/oss/cs46xx.c: fix a check after use Adrian Bunk
2005-03-27 21:21 ` Do not misuse Coverity please (Was: sound/oss/cs46xx.c: fix a check after use) Jean Delvare
2005-03-27 21:43   ` Adrian Bunk
2005-03-27 22:34     ` Jean Delvare
2005-03-27 22:45       ` Russell King
2005-03-28 12:54       ` Matthias-Christian Ott
2005-03-28 23:57     ` L. A. Walsh
2005-03-29  6:05       ` Daniel Barkalow
2005-03-29  6:23   ` Andrew Morton
2005-03-29 10:46     ` Jean Delvare
2005-03-29 14:12       ` Chris Friesen
2005-03-30  1:25       ` Horst von Brand
2005-03-30  7:53         ` Do not misuse Coverity please Jean Delvare
2005-03-30 17:09           ` Horst von Brand
2005-04-11 20:23             ` Pavel Machek
2005-03-30 18:29           ` Shankar Unni
2005-03-30 18:55             ` Olivier Galibert
2005-03-31  2:01               ` Patrick McFarland
2005-03-30 19:14             ` Paulo Marques
2005-03-30 23:11               ` Big GCC bug!!! [Was: Re: Do not misuse Coverity please] Kyle Moffett
2005-03-30 23:38                 ` Not a GCC bug (was Re: Big GCC bug!!! [Was: Re: Do not misuse Coverity please]) Jakub Jelinek
2005-03-31  0:58                   ` Kyle Moffett [this message]
2005-03-31  1:12                     ` Nick Piggin
2005-03-31  1:27                       ` Kyle Moffett
2005-03-29 14:22     ` Do not misuse Coverity please (Was: sound/oss/cs46xx.c: fix a check after use) Daniel Jacobowitz
2005-03-29 22:37       ` Kyle Moffett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8fc51864bab0a24b04af9867d748f5f@mac.com \
    --to=mrmacman_g4@mac.com \
    --cc=akpm@osdl.org \
    --cc=bunk@stusta.de \
    --cc=jakub@redhat.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmarques@grupopie.com \
    --cc=shankarunni@netscape.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome