[Scons-users] Fwd: Help with scons: warning: No dependency generated for file: stdlib.h

Jason Fritz jasonfritzpublic at gmail.com
Tue Apr 8 15:15:29 EDT 2014


Hi Bill,

I don't know how you could do this in general, but for gcc perhaps you
could parse to output of the C pre-processor's search list, e.g.:
`gcc -print-prog-name=cc1plus` -v

If the file is located in those paths, it is a system header file,
otherwise it is not.

But, in hindsight, perhaps this is not an important feature. I say that
because if SCons cannot find the include file, then it's likely that the
compiler also cannot find the include file and the compile will fail.
Unless, perhaps, there was macro-magic in the source files which enabled
the pre-processor to decipher the include filename/path but would break
SCons parsing.

Thanks again for everyone's help in resolving my issue.
- Jason


On Tue, Apr 8, 2014 at 12:41 PM, Bill Deegan <bill at baddogconsulting.com>wrote:


> Jason,

>

> How would SCons determine that the header file in question is a system

> header file?

> (Other than to maintain an exhaustive list?)

> Remember that compilers may specify their own "system" header file path

> and check for those prior to /usr/include for example.

>

> -Bill

>

>

> On Tue, Apr 8, 2014 at 11:18 AM, Jason Fritz <jasonfritzpublic at gmail.com>wrote:

>

>> Hi Dirk,

>>

>> On Tue, Apr 8, 2014 at 12:03 PM, Dirk Bächle <tshortik at gmx.de> wrote:

>>

>>>

>>> On 08.04.2014 19:42, Jason Fritz wrote:

>>>

>>>> Hi all,

>>>>

>>>> It seems the problem is related to turning on all warnings

>>>> (specifically the DependencyWarning class), but shouldn't that be a safe

>>>> "best practice"?

>>>>

>>>>

>>> , you mean like everyone compiles his C/CPP files with "-Wall -Wextra

>>> -Werror" by default? ;)

>>>

>>

>> What, doesn't everybody do that?? :)

>>

>> Seriously, though, to my newbie mind, it seemed like a good/safe thing to

>> do to enable all warnings. I would expect you wouldn't get any warnings in

>> normal situations like including system header files. Maybe you should

>> enhance the DependencyWarning class to not report this warning for system

>> headers? Otherwise the warning is basically meaningless, because any

>> "real" warnings about missing header files (i.e. files you actually care

>> about) will get lost in the clutter.

>>

>>

>>> I can understand that you'd really like to get rid of warnings, because

>>> they're often the path to full-grown errors and clutter the output. But

>>> there is a good reason to simply ignore these warnings in your case.

>>> As you suggested, you could add the required include paths for the

>>> system headers to CPPPATH. Then the warnings would go away, but you'd have

>>> much larger update times because SCons now checks the system headers for

>>> changes too. Every time, even though they'll never change...well not

>>> *never*, but the chances for this are rather low.

>>>

>>> So, both of your solutions are fine, you just have to pick the best

>>> tradeoff "no warnings" vs. "update speed" for your case.

>>>

>>

>> Thanks a lot for this explanation! It's now clear to me that I should

>> just turn off this particular warning. Yes, I don't care about SCons

>> checking the system headers for changes.

>>

>> Best regards,

>> Jason

>>

>> _______________________________________________

>> Scons-users mailing list

>> Scons-users at scons.org

>> http://four.pairlist.net/mailman/listinfo/scons-users

>>

>>

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140408/655c7fdd/attachment.htm


More information about the Scons-users mailing list