develooper Front page | perl.perl5.changes | Postings from October 2021

[Perl/perl5] f164b0: Teach Configure and cflags.SH about C99

From:
Nicholas Clark via perl5-changes
Date:
October 11, 2021 12:20
Subject:
[Perl/perl5] f164b0: Teach Configure and cflags.SH about C99
Message ID:
Perl/perl5/push/refs/heads/smoke-me/nicholas/C99/41a65e-9d9d7f@github.com
  Branch: refs/heads/smoke-me/nicholas/C99
  Home:   https://github.com/Perl/perl5
  Commit: f164b03f26e337e776ec346a69fa320276c12af1
      https://github.com/Perl/perl5/commit/f164b03f26e337e776ec346a69fa320276c12af1
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M Configure
    M Cross/cflags-cross-arm
    M cflags.SH

  Log Message:
  -----------
  Teach Configure and cflags.SH about C99

Probe to see whether we need -std=gnu99 or -std=c99 to get C99 code to
compile. In cflags.SH, remove code that added gcc warning flags that were
compatible with C89 but are not compatible with C99.


  Commit: b6d4a51955bf454f572e6fb01f52548cad32805f
      https://github.com/Perl/perl5/commit/b6d4a51955bf454f572e6fb01f52548cad32805f
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M Configure

  Log Message:
  -----------
  Test declarations after statement in Configure's C99 probe code

Also ensure that the relevant failure error message is output even with
Configure's -s flag, as we shouldn't stay silent for a message that causes
Configure default to aborting.

With these changes, Configure will fail the C99 probe test if passed
-Accflags="-Werror=declaration-after-statement" or
-Accflags="-Werror=long-long"


  Commit: 4317edf2fe571fd26931cfe1a07349b7a00bcfa0
      https://github.com/Perl/perl5/commit/4317edf2fe571fd26931cfe1a07349b7a00bcfa0
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M cflags.SH

  Log Message:
  -----------
  cflags.sh should not add -std=c99 if -std=gnu99 is already set

Having both looks like it ought to cause the build to fail, as with -std=c99
second it will override any previous -std=gnu99, and some platforms need the
former to both compile C99 code and have correct includes during Configure
probing.

However testing on those platforms without this change doesn't show any
errors. So this change doesn't seem to strictly be necessary. But it does
prevent our generated compiler command lines having contradictory flags,
and hence looking daft.


  Commit: df4426336c5464061f6692d856a30c00bffca898
      https://github.com/Perl/perl5/commit/df4426336c5464061f6692d856a30c00bffca898
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M INSTALL
    M pod/perlhacktips.pod
    M t/porting/known_pod_issues.dat

  Log Message:
  -----------
  Update perlhack with details of the C99 features we can now use

Also update INSTALL to mention C99.


  Commit: 6545b9073ba2a53ede6edead691f97be3583cbd1
      https://github.com/Perl/perl5/commit/6545b9073ba2a53ede6edead691f97be3583cbd1
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M pod/perlhacktips.pod

  Log Message:
  -----------
  Note how best to confirm that other C99 features can be relied upon

If C99 functionality can't be emulated on platforms which don't provide it,
then one really needs to test whether MSVC and the VMS compiler support it.


  Commit: 1cdb93621338fe8d429d9f0b8e821001f91b4755
      https://github.com/Perl/perl5/commit/1cdb93621338fe8d429d9f0b8e821001f91b4755
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M README.win32

  Log Message:
  -----------
  Update README.win32 to the new C99/MSVC 12.0 requirements

* Remove specific notes related to Microsoft Visual C++ 2005 Express Edition
  and earlier
* Visual Studio 2013 is the only version that still has Express edition (in
  addition to Community), so simplify the text by only mentioning Community
* Remove the reference to IA64, and mention x86_64 along with x86
* In the context of x86_64, clarify that mingw's binaries can run on both
* Update the URL for mingw


  Commit: f0534f329b0cda068265e1225d97a78e8648603c
      https://github.com/Perl/perl5/commit/f0534f329b0cda068265e1225d97a78e8648603c
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M inline.h

  Log Message:
  -----------
  Introduce a "declaration after statement" into inline.h

The core now permits some C99 code, so extensions need to ensure that any
C compiler flags they add or change permit C99 code.

This code is inlined by XS extensions in the core and on CPAN. The intent
is that this commit should show up for any failure bisection, making it
obvious what the cause is, and what the fix needs to be.


  Commit: c6eb59995079d735ed82e7431110dba4bab76906
      https://github.com/Perl/perl5/commit/c6eb59995079d735ed82e7431110dba4bab76906
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M dist/Devel-PPPort/Makefile.PL

  Log Message:
  -----------
  Devel::PPPort shouldn't unconditionally -Wdeclaration-after-statement

Add the flag for gcc for perl v5.34.4 and earlier.


  Commit: 7b607a6f4521adcdaaa92311693bf834403f8fe5
      https://github.com/Perl/perl5/commit/7b607a6f4521adcdaaa92311693bf834403f8fe5
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M pod/perldelta.pod

  Log Message:
  -----------
  perldelta for C99 support


  Commit: 9d9d7fd4ee5c01fd1cc623d0adc737a116461e44
      https://github.com/Perl/perl5/commit/9d9d7fd4ee5c01fd1cc623d0adc737a116461e44
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M INSTALL

  Log Message:
  -----------
  Add a section to INSTALL describing that we now rely on some C99

And the implications for XS authors writing code to work on both current and
earlier perl installations.


Compare: https://github.com/Perl/perl5/compare/41a65e5d9d44...9d9d7fd4ee5c



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About