NO

Author Topic: Is it just me, or...  (Read 2547 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: 1917
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.

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.