Re: Possibly an annoying test in configure

2023-08-20 Thread Torbjörn Granlund
Dennis Clarke  writes:

  Pretty sure that should be "int main (void) { return 0; } ".

Surely that is not how the implicit main() declaration looks?  A new
compiler warning is warranted.  So add (int argc, const char **argv)!
Oops, unused parameters, darn.  We need to make a fake dependency on
these unused parameters...

Alternatively, we could develop GMP.

  How hard can it be to patch that in the configure.ac autotools stuff?

It is pointless to work around compiler idiosyncrasies without a plan,
and without clear indications that it solves a real problem.

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: Possibly an annoying test in configure

2023-08-20 Thread Dennis Clarke

On 8/20/23 05:48, Torbjörn Granlund wrote:

Niels Möller  writes:

   I would *not* want to support -Werror as something to be used in general
   by users, with arbitrary compiler versions, compile flag tweaks, etc.

Indeed.

There is a fashion among compiler maintainers to accept an ever
decreasing subset of C, making any effort at producing accepted code a
wild goose chase.

I think warnings have gone from useful to mostly annoying, and that's
already without "-Werror"-like flags.



Pretty sure that should be "int main (void) { return 0; } ".

How hard can it be to patch that in the configure.ac autotools stuff?


--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional

___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: Possibly an annoying test in configure

2023-08-20 Thread Torbjörn Granlund
Niels Möller  writes:

  I would *not* want to support -Werror as something to be used in general
  by users, with arbitrary compiler versions, compile flag tweaks, etc.

Indeed.

There is a fashion among compiler maintainers to accept an ever
decreasing subset of C, making any effort at producing accepted code a
wild goose chase.

I think warnings have gone from useful to mostly annoying, and that's
already without "-Werror"-like flags.

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: Possibly an annoying test in configure

2023-08-20 Thread Niels Möller
Dennis Clarke  writes:

> With GMP ver 6.3.0 I run into the same sort of thing :
>
> conftest.c:2:10: error: a function declaration without a prototype is
> deprecated in all versions of C [-Werror,-Wstrict-prototypes]
> int main () { return 0; }
>  ^
>   void

The configure script is really not written to support running with
-Werror, and I suspect that fixing that properaly would be a rather
large undertaking. In particular to support it in combination with
arbitrary other warning options that might be enabled by users, like
-Wall, -Wextra or -pedantic.

Even supporting building the library itself with -Werror is rather
questionable, imo.

My view on -Werror is that it is useful for a maintainer that aims to
address certain warnings on certain compilers/platforms, and is prepared
to fix all resulting errors by code changes or tweaks of -Wno-foo
options.

I would *not* want to support -Werror as something to be used in general
by users, with arbitrary compiler versions, compile flag tweaks, etc.
It would be good to properly document support or lack thereof.

(Which doesn't mean that I'm against bug reports about fixing particular
warnings; making small code changes to avoid warings is often a good
thing, imo).

> int main () { return 0; }
> configure:7072: result: no
> configure:7310: error: could not find a working compiler, see
> config.log for details
>
>
> This is seen on FreeBSD 14.0 on a RISC-V machine ( the SiFive board )
> however I bet it happens just about anywhere if one goes with strict
> C99 CFLAGS.

My expectation is that if not using the -Werror option (or equivalent
for other compilers), the test is very widely portable in practice.

Since gmp doesn't support K C any longer, it would make some sense to
update GMP-specific tests to use proper prototypes, but as far as I'm
aware, many of the "standard" autoconf macros still intentionally skip
prototype declarations, e.g., to test for existence of a function that
may have slightly different prototype on different systems. So even
fixing all GMP-specific tests would likely not solve your problem (but
feel free to try that out, if you believe that would be useful).

Regards,
/Niels

-- 
Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677.
Internet email is subject to wholesale government surveillance.
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs