Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366850

Summary: Juno M4 Hello World C program marks EXIT_SUCCESS macro in error
Product: [Tools] CDT Reporter: Jeff Johnston <jjohnstn>
Component: cdt-indexerAssignee: Project Inbox <cdt-indexer-inbox>
Status: CLOSED DUPLICATE QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, malaperle
Version: 8.1.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Jeff Johnston CLA 2011-12-15 13:04:32 EST
Create a simple Managed C Hello World program from the C Project Wizard templates.
Build the project and open the hello.c source file.  The EXIT_SUCCESS macro is marked in error by CODAN and the macro cannot be hovered over.  An indexer  freshen all files causes the marker to go away and the macro is known to the hover help.  The freshen step should not be required.
Comment 1 Markus Schorn CLA 2011-12-22 09:44:11 EST
This actually works for me:
* The editor is opened automatically after creating the project and shows the errors.
* When the indexer (which is triggered automatically) is done, the editor automatically starts the reconciler and the errors go away.

Is my workflow different to yours? In your case, do the errors go away if you
simply close the editor and open it again?
Comment 2 Jeff Johnston CLA 2012-01-03 14:48:00 EST
(In reply to comment #1)
> This actually works for me:
> * The editor is opened automatically after creating the project and shows the
> errors.
> * When the indexer (which is triggered automatically) is done, the editor
> automatically starts the reconciler and the errors go away.
> 
> Is my workflow different to yours? In your case, do the errors go away if you
> simply close the editor and open it again?

For me, the indexer doesn't get triggered automatically.  I have to do so manually.  I am using the C/C++ for Linuxtools EPP download.  I am creating a regular C Managed Hello World Project (i.e. no Autotools).  I select Executable->Hello World project and hit Finish.  The source file shows up in the editor with the error and then I build the project via the Hammer icon.  After the successful build, the editor still shows error.  Closing and then reopening the source file has no effect.

This is on a Fedora 15 system.  I also tried installing the C/C++ SDK on the Juno M4 classic download.  Same failure sequence.
Comment 3 Markus Schorn CLA 2012-01-05 05:46:05 EST
Please use the tracing options:
   org.eclipse.cdt.core/debug/indexer/setup=true
   org.eclipse.cdt.core/debug/indexer/activity=true

When I create a hello world project, it outputs:
  Indexer: Adding new project hw
  Indexer: Setup is postponed: hw
  Indexer: Setup is postponed: hw
  Indexer: Creation for project hw
  Indexer: PDOMImporter start
  Indexer: PDOMImporter completed, ok=false
  Indexer: Rebuiding for project hw
  Indexer: start PDOMRebuildTask
  Indexer: parsing \hw\src\hw.c
  ...
Comment 4 Jeff Johnston CLA 2012-01-05 11:49:31 EST
(In reply to comment #3)
> Please use the tracing options:
>    org.eclipse.cdt.core/debug/indexer/setup=true
>    org.eclipse.cdt.core/debug/indexer/activity=true
> 
> When I create a hello world project, it outputs:
>   Indexer: Adding new project hw
>   Indexer: Setup is postponed: hw
>   Indexer: Setup is postponed: hw
>   Indexer: Creation for project hw
>   Indexer: PDOMImporter start
>   Indexer: PDOMImporter completed, ok=false
>   Indexer: Rebuiding for project hw
>   Indexer: start PDOMRebuildTask
>   Indexer: parsing \hw\src\hw.c
>   ...

Ok, the indexer is definitely running, but the error is still shown and isn't cleared.  I tried closing the file in the editor and then re-opening.  No change.  The EXIT_SUCCESS macro should have been found in stdlib.h which it shows it is parsing.

Application Started: 8818
Indexer: Adding new project hellotest
Indexer: Setup is postponed: hellotest
Indexer: Creation for project hellotest
Indexer: PDOMImporter start
Indexer: PDOMImporter completed, ok=false
Indexer: Rebuiding for project hellotest
Indexer: start PDOMRebuildTask
Indexer: parsing /hellotest/src/hellotest.c
Indexer: adding file:/usr/include/bits/wordsize.h
Indexer: adding file:/usr/include/sys/cdefs.h
Indexer: adding file:/usr/include/gnu/stubs-64.h
Indexer: adding file:/usr/include/gnu/stubs.h
Indexer: adding file:/usr/include/features.h
Indexer: adding file:/usr/lib/gcc/x86_64-redhat-linux/4.6.1/include/stddef.h
Indexer: adding file:/usr/include/bits/typesizes.h
Indexer: adding file:/usr/include/bits/types.h
Indexer: adding file:/usr/lib/gcc/x86_64-redhat-linux/4.6.1/include/stddef.h
Indexer: adding file:/usr/include/wchar.h
Indexer: adding file:/usr/include/_G_config.h
Indexer: adding file:/usr/lib/gcc/x86_64-redhat-linux/4.6.1/include/stdarg.h
Indexer: adding file:/usr/include/libio.h
Indexer: adding file:/usr/include/bits/stdio_lim.h
Indexer: adding file:/usr/include/bits/sys_errlist.h
Indexer: adding file:/usr/include/stdio.h
Indexer: adding file:/usr/lib/gcc/x86_64-redhat-linux/4.6.1/include/stddef.h
Indexer: adding file:/usr/include/bits/waitflags.h
Indexer: adding file:/usr/include/bits/endian.h
Indexer: adding file:/usr/include/bits/byteswap.h
Indexer: adding file:/usr/include/endian.h
Indexer: adding file:/usr/include/bits/waitstatus.h
Indexer: adding file:/usr/include/time.h
Indexer: adding file:/usr/lib/gcc/x86_64-redhat-linux/4.6.1/include/stddef.h
Indexer: adding file:/usr/include/bits/select.h
Indexer: adding file:/usr/include/bits/sigset.h
Indexer: adding file:/usr/include/time.h
Indexer: adding file:/usr/include/bits/time.h
Indexer: adding file:/usr/include/sys/select.h
Indexer: adding file:/usr/include/sys/sysmacros.h
Indexer: adding file:/usr/include/bits/pthreadtypes.h
Indexer: adding file:/usr/include/sys/types.h
Indexer: adding file:/usr/include/alloca.h
Indexer: adding file:/usr/include/stdlib.h
Indexer: adding file:/notnfs/jjohnstn/workspace-test-m4/hellotest/src/hellotest.c
Indexer: completed PDOMRebuildTask[457ms]

I then do "freshen all files"

bash $ Indexer: start PDOMUpdateTask
Indexer: parsing /hellotest/src/hellotest.c
Indexer: adding file:/usr/include/stdio.h
Indexer: adding file:/usr/include/bits/waitstatus.h
Indexer: adding file:/usr/include/stdlib.h
Indexer: adding file:/notnfs/jjohnstn/workspace-test-m4/hellotest/src/hellotest.c
Indexer: completed PDOMUpdateTask[117ms]

That clears the error.  Any other options I should try?  Is there a way to see what macros it knows about after the first pass?
Comment 5 Marc-André Laperle CLA 2012-01-05 23:22:09 EST
It looks like some headers are missing. Do you have the gcc-c++ package (C++ support for GCC) ?
Comment 6 Marc-André Laperle CLA 2012-01-05 23:23:39 EST
(In reply to comment #5)
> It looks like some headers are missing. Do you have the gcc-c++ package (C++
> support for GCC) ?

Never mind, just read it's a C project, not C++ :p
Comment 7 Marc-André Laperle CLA 2012-01-08 00:37:50 EST
I tried with Fedora 15 and Juno M4 and I got the same error. Then I updated to the nightly build and it went away.

https://hudson.eclipse.org/hudson/job/cdt-nightly/
Comment 8 Markus Schorn CLA 2012-01-09 06:53:17 EST
Thanks Jeff and Mark-Andre, with your information I am 99% sure this is a duplicate of bug 367753.

*** This bug has been marked as a duplicate of bug 367753 ***