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.