[Yetanotherclib-devel] dprintf namespace conflicts
Status: Planning
Brought to you by:
ostolski
From: Jeffrey B. <je...@e-...> - 2004-08-26 18:33:46
|
Hello. The function dprintf() conflicts with a GNU extension of the same name. This means that any program that links with yaclib and also uses GNU extensions will fail compilation with an error indicating a previous definition of dprintf at stdio.h. The standard library includes a warn function with the same functionality, though it is not recommended as it is a BSD-specific function. The most portable solution to this problem is an fprintf to stderr, as fprintf is of course a standard library function available everywhere. Another idea to consider is the use of error(), though this solution is less likely as its availability across platforms may be limited. The only convenience that the dprintf function included in YAclib provides is a call without the necessity of specification of stderr. Therefore, for the usefulness of this library within projects utilizing the GNU extensions, I will replace instances of dprintf() with fprintf(stderr,). Regards, Jeff |