Re: src/tds/types.h

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <1303487396.10435.0.camel@ricky>
Il giorno ven, 22/04/2011 alle 08.36 -0500, Craig A. Berry ha scritto:
> I'm running into a problem building src/tds/unittests/convert.c on VMS.  It includes sys/time.h, which on this system includes in.h, which in turn includes types.h, but obviously it wants the system-level types.h, not the local one in src/tds.[1]
> 
> However, because convert.c needs other include files from src/tds, the compiler searches that directory first, gets the wrong header, and fails because src/tds/types.h needs all sorts of definitions which the compiler hasn't seen yet.
> 
> It looks like src/tds/types.h is just an appendage to data.c and isn't installed, so could we please name it something that doesn't conflict with a system-level header?  Maybe tds_types.h, or data_types.h, or even just data.h?
> 
> Naming a header the same as one supplied by the system seems a little dubious and some folks even consider it a security risk:
> 
> <https://www.securecoding.cert.org/confluence/display/seccode/PRE04-C.+Do+not+reuse+a+standard+header+file+name>
> 
> 
> [1]  With the HP C compiler, the "sys/" part of <sys/types.h> is optional and the system-supplied headers themselves don't always use it.  Even if that's a bug, it's one I can't fix.
> 
> ________________________________________
> Craig A. Berry
> mailto:[email protected]
> 
> "... getting out of a sonnet is much more
>  difficult than getting in."
>                  Brad Leithauser
> 

Good catch, fixed

freddy77
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.