Different compiler warnings, when in different source files

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

After successfully having an entirely unrelated thread closed out with a solution today - I thought I'd try my luck at closing out one more point that's been bugging me...

I'm working on a project that I've been on for many months on and off now, which contains many 10s of source files and headers, and ~100k LOC. I'll admit there's a few bits to work through still, and so I have some compiler warnings and messages.

I've noticed in AS7, depending on which source file I have open in studio at the time on compilation (either rebuild, build or clean) - I get a different number of warnings/errors.

This seems illogical to me, as the entire application is still being compiled?

What gives?

This topic has a solution.
Last Edited: Sun. Sep 13, 2020 - 08:12 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Compilation is incremental by default, do only changed or uncompiled files are compiled, to speed up the compilation progress. So, if a file has warnings, but compiles successfully, it will now show up in the warning lists until the next rebuild.

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In that case, clean the build to get the most complete list of warnings and errors.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Got it, thanks Meolson... So obvious in hindsight, I've never seen this behaviour when compiling from the command line, so AS is simply deciding not to compile certain files!

ka7ehk wrote:

In that case, clean the build to get the most complete list of warnings and errors.

 

Jim

Hehe ...because just cracking on oblivious to why something you don't understand is happening never ended badly for anybody :D

Cheers both

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jtw_11 wrote:
I've never seen this behaviour when compiling from the command line
You weren't using make then?
.
Because of the size of AVR projects I'd be tempted to use "rebuild solution" every time so everything is recompiled and you'll see all the warnings so you can work through removing the reason for each one (you should!).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

jtw_11 wrote:
I've never seen this behaviour when compiling from the command line

You weren't using make then?
.
Because of the size of AVR projects I'd be tempted to use "rebuild solution" every time so everything is recompiled and you'll see all the warnings so you can work through removing the reason for each one (you should!).

No, just simple windows terminal apps calling gcc -o app.exe xx.c yy.c

Though I am now going to go and manually compile via terminal, using make... Just to see it do the same thing!

Agreed on working through the list, I always work a project to 0 warnings and messages where possible.

Thanks all