[Bug c++/79300] New: Wrong diagnostics position

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 31 08:48:00 GMT 2017


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

            Bug ID: 79300
           Summary: Wrong diagnostics position
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

Let's consider following test-case:

$ cat memtable.cc
#include <assert.h>
void
a ()
{
  long val_size;
  unsigned long encoded_len;
  char *buf, *p;
  assert ((p + val_size) - buf == encoded_len);
}


$ g++ memtable.cc -Wsign-compare -c
In file included from memtable.cc:1:0:
memtable.cc: In function ‘void a()’:
memtable.cc:8:32: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
   assert ((p + val_size) - buf == encoded_len);
           ~~~~~~~~~~~~~~~~~~~~~^~~~

Tilda line ends after the first letter of 'encoded_len', which is wrong.


More information about the Gcc-bugs mailing list