[Mesa-dev] g3dvl odds & ends
Younes Manton
younes.m at gmail.com
Fri Aug 26 18:47:33 PDT 2011
On Fri, Aug 26, 2011 at 5:54 PM, Zack Rusin <zackr at vmware.com> wrote:
> On Friday, August 26, 2011 05:12:52 PM Younes Manton wrote:
>> On Fri, Aug 26, 2011 at 4:31 PM, Brian Paul <brianp at vmware.com> wrote:
>> > Two things that should probably be fixed in the src/gallium/auxiliary/vl/
>> > code:
>> >
>> > 1. The copyright statements refer to Tungsten Graphics. That's probably
>> > a copy & paste error. s/Tungsten Graphics/the authors/ or thereabouts.
>> >
>> > 2. #includes of gallium headers should use "" instead of <> just to be
>> > consistent with the rest of gallium.
>> >
>>
>> Any particular reason for 2 being the way things are done? There's no
>> point in doing it if the header isn't the same dir as the source file,
>> and it's probably even worse for compile time since you're needlessly
>> searching the current directory.
>
> You know there's little point in asking a question if you're going to right
> away answer it yourself in a condescending manner. It's passive aggressive and
> it's irritating.
>
> Attitude aside that's not what the difference between <> and "" is. In fact the
> standard says that the difference is implementation dependent. Our most common
> compiler says this:
> http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html
>
> #include <file>
> This variant is used for system header files.
> #include "file"
> This variant is used for header files of your own program.
>
> So the reason it's done is because:
> a) according to our favorite compiler "" is used for header files of your own
> program, which gallium headers are,
> b) most importantly, especially for people using different compilers on
> different systems where the differences between <> and "" can be arbitrary:
> because it's the style that is used by the rest of the project.
If we want to be that pedantic, we are misusing -I then because we are
mostly using incomplete paths in "" and relying on the wrong switch
(which our favourite compiler says is for system headers, as opposed
to -iquote) and the fall-back to <>'s behaviour to make it work. I
personally favour practicality over pedantry.
So, we can be practical, just use <> and save a bit of compile time;
or we can stick to the current scheme (which has us abiding by our
favourite compiler's intended yet meaningless and often ignored use of
"" while we simultaneously pervert it's intended use of -I and
needlessly search the current dir for many includes)... for which
tangible benefits?
If we're going to bother specifying how to include files I prefer a
bit of compile time saving and/or other tangible benefits to
practically nothing, hence a simple question asking if there were any
reasons why things are done the way they currently are and giving a
reason why I think it should be another way. There's nothing here for
anyone to get irritated about.
More information about the mesa-dev
mailing list