Liste des Groupes | Revenir à cl c |
On Wed, 13 Mar 2024 11:45:31 +0000I'd agree it seems a poor choice of defaults.
bart <bc@freeuk.com> wrote:>
>
This is something new I saw today: suppose I have hello.c in a
directory (hello.c uses '#include <stdio.h>').
>
If I create an empty file called 'stdio.h', then 4 compilers I tried
all picked up that file instead of their official stdio.h. That looks
a dangerous practice to me.
What exactly was the "-I" option you gave (and which compiler)? If you wrote "-I.", including the dot, then gcc will act the way you describe - that's what the flag does. If you put other directories in the -I list, it does not look in the current directory.>I just tried three compilers and [in absence of -I options] all 3 work
It also seems, for a <...> file, to ignore the official repository
and look first within the user's project. So what exactly is the
difference between <...> and "..."? Is it just an extra set of backup
paths to look if it can't find anything within the user's files?
>
(The 5th compiler I tried ignored it and worked as normal; that was
mine. I can make it fail using my '-ext' option to look elsewhere
than the official headers location. I don't make a distinction
between <...> and "...".)
>
>
as expected, i.e. ignored stdio.h in current directory.
None of the three was of the variety that you appear to prefer.
Mine's are mundane stuff.
However all three took local file when I had given them an option -I.
Not sure what to make of this.
Whatever happens with
non-default options is probably in "implementation-defined"
domain as far as the C Standard is concerned, but I still
expected that such common option as -I would not affect standard
headers.
Les messages affichés proviennent d'usenet.