[cfe-dev] clang++ r235810: gdb doesn't enter some C++ functions, libcxx-pretty-printers don't work, misses signed/unsigned comparisons, etc etc

David Blaikie dblaikie at gmail.com
Sun Apr 26 11:37:40 PDT 2015


On Sat, Apr 25, 2015 at 7:16 PM, Yuri <yuri at rawbw.com> wrote:
> I noticed that clang++ produces code in which gdb doesn't enter some
> functions, when clang-3.4.1 didn't have such problem. All compiled with
-g,
> and no -O options

Could you provide a/some concrete example(s)? (preferably small/standalone
examples (no header inclusions, etc))

> Additionally, STL containers aren't printed with pretty-printers. Is this
> not the right git repository location
> https://github.com/koutheir/libcxx-pretty-printers ?
>
> gcc compiled code is free of both problems.
>
> Additionally, gcc found the problem of signed vs. unsigned comparison:
> int i;
> vector<...> v;
> if (i >= v.size())   // <==== **** Here gcc finds the problem, and clang
> doesn't, as I think it should

Seems to warn, if you turn on the -Wsign-comparison:

vec.cpp:4:12: warning: comparison of integers of different signs: 'int' and
'size_type' (aka 'unsigned long') [-Wsign-compare]
  return i < v.size();
         ~ ^ ~~~~~~~~

> Also, gcc found that 'memcpy' not defined (#include <string.h> was really
> missing). Same with 'close' function and missing header unistd.h. I doubt
> that headers change depending on compiler. Not sure what to think here,
but
> g++ seems to be more right than clang++.
>
> gdb-7.8.2, FreeBSD 10.1
> plain C++ code, compiler with -Wall -g -std=c++11 and linked with -g
>
> BTW, a long while ago I reported the bug that llvm produces clearly wrong
> debug info, with a very short and particular test case, and you just never
> fixed this, in "no comment" style.

Got a pointer to the bug number?

> This debug info problem here with C++
> might be directly related to that.
>
> Yuri
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150426/e8331490/attachment.html>


More information about the cfe-dev mailing list