Fwd: Re: libassuan troubles
Michael Nottebrock
michaelnottebrock at gmx.net
Mon Apr 19 08:22:50 PDT 2004
Standards issues like these are over my head, so I'm forwarding this here,
hoping some experts can comment on it.
---------- Forwarded Message ----------
Subject: Re: libassuan troubles
Date: Monday 19 April 2004 17:15
From: Marcus Brinkmann <marcus.brinkmann at ruhr-uni-bochum.de>
To: Michael Nottebrock <michaelnottebrock at gmx.net>
Cc: gpa-dev at gnupg.org
At Mon, 19 Apr 2004 16:54:37 +0200,
Michael Nottebrock wrote:
> [1 <text/plain; iso-8859-1 (quoted-printable)>]
>
> On Monday 19 April 2004 16:34, Marcus Brinkmann wrote:
> > This seems spurious. Maybe putc_unlocked is only defined as a macro
> > on BSD, and thus circumvents the autoconf tests? This would sound
> > broken to me (it may be allowed to define it as a macro, but it should
> > still be defined as a function in the library).
>
> Yes, it's a macro. However, I don't see what's wrong about that other than
> making autoconf's life harder.
putc_unlocked is specified as a function that may be defined as a
macro. The fact that it is defined as a macro does not relief you
from also declaring and defining it as a function. IE, the following
must be possible in a program:
#undef putc_unlocked
putc_unlocked ('a');
At least this is my interpretation of the wording in POSIX. In fact,
if you not only take into account the specification, but also the
application usage, it becomes apparent:
16064 APPLICATION USAGE
16065 Since they may be implemented as macros, getc_unlocked( )
and putc_unlocked( ) may treat 16066 incorrectly a stream
argument with side effects. In particular, getc_unlocked(*f++) and 16067
putc_unlocked(*f++) do not necessarily work as expected. Therefore,
use of these functions in 16068 such situations should be
preceded by the following statement as appropriate: 16069
#undef getc_unlocked
16070 #undef putc_unlocked
The autoconf test relies on the function in the library object file.
This will work for almost all functions, except those for which POSIX
explicitely allows the lack of a function definition (like setjmp,
FD_CLR, etc).
Thanks,
Marcus
-------------------------------------------------------
--
,_, | Michael Nottebrock | lofi at freebsd.org
(/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org
\u/ | K Desktop Environment on FreeBSD | http://freebsd.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: signature
Url : http://lists.freebsd.org/pipermail/freebsd-standards/attachments/20040419/cd706f02/attachment.bin
More information about the freebsd-standards
mailing list