Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ptp-user] CDT codan worries

Hi,

it took me a while to tame CDT codan for a more recent gcc 
version. I finally solved my problems, but I am wondering whether 
I should enter my "lessons learned" into some FAQ or other 
documentation. --- Potentially for CDT rather than PTP ? But I 
darkly remember that there are already some Codan entries in one 
of the PTP FAQs.

Please advise how I should handle the following information.

I was using Ubuntu 16.04, but people were reporting in various 
fora and stackoverflow that they had similar problems with
earlier versions of Ubuntu.

The important thing seems to be that several versions of gcc
are installed on the system. If so, each of them comes with
a separate version of stddef.h. Ubuntu provides /usr/include/
linux/stddef.h, but this file is empty. This may fool Codan in 
believing it had found and included stddef.h .

But then Codan still flags "NULL" and "size_t" as undefined.

I was using a cmake_wrapper.sh as external make command in 
Eclipse PTP, and CMake got the include path for stddef.h right.
So the compilation step included the right file. But Codan was 
still left in the dark.

I had to go to C++General->Paths an Symbols and explicitly add
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/include to point to the right 
version of stddef.h . I would think that this path is *not* very 
obvious.
 
-- 

Mit freundlichen Grüßen / Kind regards

Dr. Christoph Pospiech
High Performance & Parallel Computing
Phone: +49-351 86269826
Mobile: +49-171-765 5871
E-Mail: cpospiech@xxxxxxxxxx

Lenovo (Deutschland) GmbH
Meitnerstr. 9
D-70563 Stuttgart

Geschäftsführung: Bernhard Fauser
Sitz der Gesellschaft: Stuttgart
HRB-Nr.: 25189, AG Stuttgart
WEEE-Reg.-Nr.: DE79679404

Back to the top