This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | "true" and "false" show as syntax errors with gcc c99 | ||
---|---|---|---|
Product: | cnd | Reporter: | _ gordonp <gordonp> |
Component: | Project | Assignee: | Thomas Preisler <thp> |
Status: | RESOLVED INVALID | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
_ gordonp
2008-09-16 19:04:03 UTC
I'd like to note that this involves both code model and project system. Code model should "understand" such keywords in the case file is C99. So we have to - extend NativeFileItem interface to include C99 language flavour - make NativeFileItem implementation provide correct flavor for such files - process this on code model site According to the C99 standard, the only boolean related keyword is "_Bool", which Netbeans IDE 6.7 seems to understand. The standard defines the header file stdbool.h, containing the following macros: #define bool _Bool #define true 1 #define false 0 #define __bool_true_false_are_defined 1 The IDE apparently has trouble finding this standard header so "bool", "true" and "false", which are macros, are not defined. After further investigation, it appears that on my system (Ubuntu 9.04) "stdbool.h" is located under /usr/lib/gcc/i486-linux-gnu/4.3/include or /usr/lib/gcc/i486-linux-gnu/4.3.3/include but by default Netbeans IDE searches /usr/lib/gcc/i486-linux-gnu/4.3.2/include $ ls -l /usr/lib/gcc/i486-linux-gnu/ total 4 drwxr-xr-x 4 root root 4096 2009-04-29 10:29 4.3 lrwxrwxrwx 1 root root 3 2009-02-19 15:57 4.3.3 -> 4.3 $ gcc --version gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Changing the directory under Tools|Options|C/C++|Code Assistance makes it work. if #include directive is not resolved => it is red underlined. Hovering with mouse and pressed Ctrl+Alt will show searched paths in the order. This paths are taken from Project properties and Toolchain's include path Tools|Options|C/C++|Code Assistance So you are saying that the include paths in Tools|Options|C/C++|Code Assistance are incomplete? Is that what this bug is? I'm not sure. I think the include paths are generated correctly the first time the C++ plugin is installed, and then are kept unchanged forever, even when upgrading to a new IDE version. On the other hand, the GCC specific include paths under /usr/lib/gcc/i486-linux-gnu (as opposed to the global includes like /usr/include and /usr/local/include) do change each time the GCC version changes, which happens quite frequently, so the IDE setting gets out of sync with the actual paths. I have only experimented on Ubuntu, but this is probably the same on other Linux distros and maybe elsewhere. Perhaps the IDE setting should track the "gcc --version" value. Not clear from reading this bug report exactly what the bug is. Please try new Netbeans 6.9 and open a new bug report with clear description of what the problem is and how to reproduce it. |