Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Problems with lcc-win32 Date: Sun, 05 Mar 2017 19:35:03 -0800 Organization: None to speak of Lines: 46 Message-ID: References: <3cd2645c-a5a1-4284-8fb4-309e14ee4d8e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="249260d50d827d4343a089464177f34d"; logging-data="4984"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uppWtmufeO6BUsCORnJyA" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:n53udFRVNE6cFpYZzB1MWgIootc= sha1:lY0EhE+gilHhtZIu0/0lbML/tDw= Xref: csiph.com comp.lang.c:105460 jacob navia writes: > Le 05/03/2017 à 23:12, mertesthomas@gmail.com a écrit : [...] >> 3. A missing include file just triggers a warning. I had to change my test >> programs to use something from the include file. This way I can recognize >> when an include file is found by the C compiler. > > Well, that can be fixed easily. Will do next week. Transform the warning > in error. But... > > I am too liberal maybe? People like errors instead of warnings? > > What if you have an unused include missing? Nothing happens. Now all > those builds would crash. Is that better? > > What do you think? [...] In my opinion a missing include file should be a fatal error. (If it's unused, then don't include it.) That's certainly what I'm used to, and every compiler I've tried bails out immediately if a header is missing (it won't even try to diagnose any following errors). I suspect a lot of users would be very surprised to see a missing include diagnosed with a non-fatal warning. Feel free to consider the fact that I'm not an lcc-win user in deciding how to deal with this. On the other hand, some kind of conditional include might be a useful extension, perhaps something like: #include_if_exists and/or #if_header_exists /* ... */ #else /* ... */ #endif -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"