NO

Author Topic: Is it just me, or...  (Read 3140 times)

PhilG57

  • Guest
Is it just me, or...
« on: September 06, 2015, 08:22:52 PM »
If I have several source files in a project, one of which is, say, named "pigs.c".  I try to comiple pigs.c with v08.00.60 and get some errors due to a faulty macro.  So, wanting to see the actual problem code, I compile pigs.c with the Pelles "/P" option to produce a "pigs.i" file.  I then rename "pigs.i" to "cowspigs.c" and add cowspigs.c to the project.  No problems so far...

But when I then compile cowspigs.c, the compiler kicks out error messages referencing the original pigs.c source module, not error messages for the cowspigs.c module.  And if I double-click on the error message in the 'Project' window from that compile of cowspigs.c, I'm shown the error line in the original "pigs.c" source module, not the error line in the module just compiled which is "cowspigs.c".  The cowspigs.c module, because, it is the result of a previous compile, has lots and lots of more source lines in it, one or two or which are in error as a result of my bum macro but I still have no idea what is wrong.

Maybe a bug and maybe somehow a user error...?

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Is it just me, or...
« Reply #1 on: September 06, 2015, 08:53:11 PM »
If your problem is the reference to the 'source' file "pigs.c", it is normal.
The preprocessor emits a series of #line directives in the form:
Code: [Select]
#line num filename to move error report to the source file:
Code: [Select]
#line 10 "pigs.c"
If you want errors reported at real line remove all #line directives and try again to compile it.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

PhilG57

  • Guest
Re: Is it just me, or...
« Reply #2 on: September 07, 2015, 09:43:15 PM »
Yes!!! That was the problem.  And a simple fix was to do a mass find for the occurences of the 'old' module name and replace them with the 'new' module name.  Many thanks.