C compiler does not recognize // in line comments [message #1731573] |
Sat, 07 May 2016 00:02 |
|
Ok, this is the problem: I use yoxos to keep my eclipse up to date: and the other day I was upgraded to Mars .2 my C compiler (GCC tool Chain) stopped accepting '//' as comment lines, I checked other projects which had no errors, now have the same error.
Description Resource Path Location Type
expected expression before '/' token demo.c /demo1/Host line 98 C/C++ Problem
(93) /* STOP FLYING! */
(94)
(95) printf("\n END OF THE LINE******************************** %4d \n", count );
(96) PLatLon( dlat, dlon );
(97) /* print"</body></html>"; */
(98) // now return
(99) return(1);}
I there a freaken switch somewhere that got flipped/set wrong?
Thanks Cris
|
|
|
|
Re: C compiler does not recognize // in line comments [message #1731600 is a reply to message #1731596] |
Sat, 07 May 2016 15:40 |
|
David. here is console from the last run:
05:37:32 **** Incremental Build of configuration Debug for project demo1 ****
make all
Building file: ../Host/demo.c
Invoking: GCC C Compiler
gcc -I"/mnt/MyData/home/harrison/NexGen/Code-Base/NAV/Server/demo1/NAV_Includes" -O0 -g3 -Wall -c -fPIC -lm -fmessage-length=0 -ansi -fPIC -MMD -MP -MF"Host/demo.d" -MT"Host/demo.o" -o "Host/demo.o" "../Host/demo.c"
In file included from ../Host/demo.c:15:0:
/mnt/MyData/home/harrison/NexGen/Code-Base/NAV/Server/demo1/NAV_Includes/demo.h:81:8: warning: extra tokens at end of #endif directive [enabled by default]
#endif INCLUDE_DEMO_H
^
In file included from ../Host/demo.c:17:0:
/mnt/MyData/home/harrison/NexGen/Code-Base/NAV/Server/demo1/NAV_Includes/dme.h:20:9: warning: extra tokens at end of #endif directive [enabled by default]
#endif INCLUDE_DME_H
^
In file included from /mnt/MyData/home/harrison/NexGen/Code-Base/NAV/Server/demo1/NAV_Includes/nav_lib.h:12:0,
from ../Host/demo.c:18:
/mnt/MyData/home/harrison/NexGen/Code-Base/NAV/Server/demo1/NAV_Includes/demo.h:81:8: warning: extra tokens at end of #endif directive [enabled by default]
#endif INCLUDE_DEMO_H
^
In file included from ../Host/demo.c:18:0:
/mnt/MyData/home/harrison/NexGen/Code-Base/NAV/Server/demo1/NAV_Includes/nav_lib.h:101:8: warning: extra tokens at end of #endif directive [enabled by default]
#endif INCLUDE_NAV_LIB_H
^
../Host/demo.c: In function 'main':
../Host/demo.c:98:2: error: expected expression before '/' token
// now return
^
../Host/demo.c:99:2: warning: control reaches end of non-void function [-Wreturn-type]
return(1);}
^
make: *** [Host/demo.o] Error 1
05:37:32 Build Finished (took 103ms)
BTW This started when eclipse upgraded to MARS .2 for Shits & Giggles I when to another project that I was working on my radios which compiled cleanly last fall and did use // comments, and now it also puking when it sees // as well
I don't have a clue I have looked in the project and window configuration files till im blind.
This source has been structured the same as I have done with eclipse and CCS6 (ti ver).
project:
->Host -> files.c
->NAV_includes -> files.h
|
|
|
|
Re: C compiler does not recognize // in line comments [message #1731610 is a reply to message #1731605] |
Sat, 07 May 2016 21:33 |
|
thank you for get me very close.. but just changing the dialect to c99 did nothing and it still had -ansi in the build comments on the console.
So I kept on looking under:
Project --> Properties --> C/C++ Build --> Settings find the Tool Settings tab -> Miscellaneous
I unchecked Support ANSI programs!! -
now it works!!
|
|
|
|
Re: C compiler does not recognize // in line comments [message #1731656 is a reply to message #1731611] |
Mon, 09 May 2016 05:27 |
|
I know I got crushed over at SO I think they are f'n full of themselves! I kept on looking in the wrong location, and then read the article about the difs between ANSI and C99. It is very misleading. Its like im in a freekn time warp. or should I say like the movie "Groundhog Day"!! over and over and over. I was looking in the wrong direction, like a chicken without its head.
Do yourself a favor if you must write in Perl (good for HTML), please don't try and convert it to C, it does not go well. That's what this project is about. I know my small demo 8865 chars in Perl is now 1252 chars of .c and 4579 chars of .h to be honest, I added a new section on calculating "Slant Range" distances. for the simulator. I figure it should have been around 12k long. and is taking way to long to code.. As I have to add in ethernet packet system.
thanks Again.
Cris.
BTW I blog up at www.element14.com/community/people/phoenixcomm/blog
|
|
|
Re: C compiler does not recognize // in line comments [message #1731696 is a reply to message #1731656] |
Mon, 09 May 2016 10:59 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
Not to necessarily defend what happened but I can see why the question was down-voted.
On the surface it seems a reasonable question but:
1) it was mistagged. You tagged it c, gcc, gcc-warning but your question clearly revolved around a recent update of Ecliipse. Had nothing to do with gcc really.
2) similar questions (about C specifically) had been asked a lot. You could have found them with little effort.
There should have been a little more leniency for a low rep questioner and someone could have stepped in and reworded it for you. Somewhat disconcertingly, they pass out badges for down-voting a question. I think down-voters should be required to explain their down-votes. But then, I'm not in charge.
Even here, you have been a bit sloppy with at least one of your posts. You titled it eclipse C project with the subtitle/summary (unknown error messages) and didn't really ask a question. The content was mostly the log output. So, lacking a question and keying off the summary, I explained several of the messages. Your response was surprisingly: I knew that. Surprising because the subtitle was "unknown error messages".
BTW: nice wording of your answer at SO. Couldn't have worded it better myself. You're welcome. Don't make a habit of doing that.
---
I usually prototype in Perl and R depending on the task. With object oriented Perl the jump to C++ is fairly straightforward and uncomplicated. I only write in C if I have to and consider it one step above having to write in assembly language. In the first few spacecraft projects I worked on, the onboard software was entirely in assembly language (with scaled integer arithmetic!). Nowadays, C is used a lot but still almost as tedious as assembly. On some projects it's a requirement imposed from above.
[Updated on: Mon, 09 May 2016 11:17] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02436 seconds