[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gnulib] Re: same, utimecmp should depend on minmax

From: Bruno Haible
Subject: [bug-gnulib] Re: same, utimecmp should depend on minmax
Date: Mon, 23 May 2005 21:41:44 +0200
User-agent: KMail/1.5

Paul Eggert wrote:
> Won't this run into a problem when (for
> example) private headers include system headers?  E.g.,
>    // module being implemented
>    #include "my-interface.h"
>    // system headers
>    #include <stdio.h>
>    // gnulib and private headers
>    #include "minmax.h"
>    #include "private-header.h"
> where private-header.h includes <utility.h> when HAVE_UTILITY_H, and
> this happens to be the first inclusion of <utility.h>.  (Solaris 10
> <utility.h> defines MIN.)

Yes, this would run into the same problem. However, these constellations
are rare because:

  - Collisions occur mostly with rarely used headers, such as <utility.h>,
    <sys/ucred.h> or similar.

  - gnulib headers and private headers normally #include only well-known,
    POSIX system headers. (1. because of portability, 2. because these
    rarely used headers rarely define useful types that need to be present
    in the .h file.) So, often the only references to rarely used headers
    is through the
       // system headers
    section of a .c file.

This explains why so few problems occur with this technique in practice.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]