public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/89788] trunk/liboffloadmic/runtime/emulator/coi_host.cpp:175]: (error) Null pointer dereference (missed -Wnull-dereference)
       [not found] <bug-89788-4@http.gcc.gnu.org/bugzilla/>
@ 2020-06-08 19:57 ` msebor at gcc dot gnu.org
  2022-11-04 10:55 ` tschwinge at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-06-08 19:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89788

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org
             Blocks|86172                       |

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
The code is still in liboffloadmic/runtime/emulator/coi_host.cpp but I wonder
why it isn't diagnosed.  Passing a null pointer of any other type but char* to
%s is diagnosed by -Wformat.  Usually only with optimization, passing a null
pointer to %s is then diagnosed by -Wformat-overflow.  A test case for the
latter is below.

Could something like -Wno-system-headers be somehow disablig it?

$ cat pr89788.c && gcc -O2 -S -Wall -Wextra pr89788.c
#include <dirent.h>
#include <stdio.h>

void f (const char *path)
{
  DIR *p = opendir (path);
  if (!p)
    fprintf (stderr, "error: %s", (char*)p);
}
pr89788.c: In function ‘f’:
pr89788.c:8:5: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
    8 |     fprintf (stderr, "error: %s", (char*)p);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86172
[Bug 86172] [meta-bug] issues with -Wnull-dereference

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug target/89788] trunk/liboffloadmic/runtime/emulator/coi_host.cpp:175]: (error) Null pointer dereference (missed -Wnull-dereference)
       [not found] <bug-89788-4@http.gcc.gnu.org/bugzilla/>
  2020-06-08 19:57 ` [Bug target/89788] trunk/liboffloadmic/runtime/emulator/coi_host.cpp:175]: (error) Null pointer dereference (missed -Wnull-dereference) msebor at gcc dot gnu.org
@ 2022-11-04 10:55 ` tschwinge at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2022-11-04 10:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89788

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|i?86-intelmic               |
                 CC|                            |tschwinge at gcc dot gnu.org

--- Comment #6 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
This liboffloadmic code is gone after commit
r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 "Remove support for Intel
MIC offloading", but I'm leaving this PR open, as it's not specifically about
liboffloadmic code, but rather about a missing GCC compile-time diagnostic, as
I understand this.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-04 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-89788-4@http.gcc.gnu.org/bugzilla/>
2020-06-08 19:57 ` [Bug target/89788] trunk/liboffloadmic/runtime/emulator/coi_host.cpp:175]: (error) Null pointer dereference (missed -Wnull-dereference) msebor at gcc dot gnu.org
2022-11-04 10:55 ` tschwinge at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).