https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113152
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
--- Comment #16 from anlauf at gcc dot gnu.org ---
(In reply to Steve Kargl from comment #14)
> On Sun, Jan 21, 2024 at 09:52:39PM +0000, anlauf at gcc dot gnu.org wrote:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113152
> >
> > I think that you cannot do
> >
> > + if (MPFR_HALF_CYCLE)
> >
> > you really must use
> >
> > #if MPFR_HALF_CYCLE
> >
>
> #include <stdio.h>
> #include "mpfr.h"
>
> #define MPFR_HALF_CYCLE (MPFR_VERSION_MAJOR * 100 + MPFR_VERSION_MINOR >=
> 402)
>
> int
> main(void)
> {
> if (MPFR_HALF_CYCLE)
> printf("here\n");
> else
> printf("there\n");
> return (0);
> }
>
> % cc -o z -I/usr/local/include a.c && ./z
This does not test the right thing.
% cat sgk.cc
#include <stdio.h>
#define MPFR_HALF_CYCLE 0
int
main(void)
{
if (MPFR_HALF_CYCLE)
printf_not_declared_if_0 ("here\n");
else
printf ("there\n");
return (0);
}
% g++ sgk.cc
sgk.cc: In function 'int main()':
sgk.cc:9:7: error: 'printf_not_declared_if_0' was not declared in this scope
printf_not_declared_if_0 ("here\n");
^~~~~~~~~~~~~~~~~~~~~~~~