Patch for res_init() check in acinclude.m4.in
Michael Matz
matz at kde.org
Tue Apr 8 07:56:16 BST 2003
Hi,
On Mon, 7 Apr 2003, Albert Chin-A-Young wrote:
> > > - [ AC_MSG_RESULT(no) ]
> > > - )
> > > + [res_init()],
> >
> > This must be a complete C-statement, i.e. including the final ';'. Given
> > that it is missing here, I suppose this never was correctly tested, so I'm
> > not yet applying it yet. But if you fix, I might ;-)
>
> Really?
Well, sort of.
> From acinclude.m4:
> AC_DEFUN(AC_CHECK_SETENV,
> [
> KDE_CHECK_FUNC_EXT(setenv, [
> #include <stdlib.h>
> ],
> [setenv("VAR", "VALUE", 1);],
Yes, please look at it again. There is a ';' here.
> [int setenv (const char *, const char *, int)],
> [SETENV])
> ])
>
> The ';' is added automatically by autoconf.
I'm not talking about the prototype, but about the actual use of the
function, i.e. the FUNCTION-BODY argument of AC_TRY_COMPILE. You are
right in one way, that a final ';' is indeed added by autoconf after
pasting that argument literally into the main() function. But we should
use it consistently, and the current style of KDE_CHECK_FUNC_EXT usage is
to have that argument by a complete statement.
Ciao,
Michael.
More information about the kde-core-devel
mailing list