[Perl/perl5] fef5fe: win32: retire visual studio 2013 support

2023-11-06 Thread Tony Cook via perl5-changes
  Branch: refs/heads/smoke-me/tonyc/retire-vs-2013
  Home:   https://github.com/Perl/perl5
  Commit: fef5fef5b45e62f8a0e1925feb73fc3ce42e2ad1
  
https://github.com/Perl/perl5/commit/fef5fef5b45e62f8a0e1925feb73fc3ce42e2ad1
  Author: Tony Cook 
  Date:   2023-11-07 (Tue, 07 Nov 2023)

  Changed paths:
M README.win32
M win32/GNUmakefile
M win32/Makefile

  Log Message:
  ---
  win32: retire visual studio 2013 support

I recently (tried) to test VS 2013 builds, but while vs2013 in theory
supports mixed declarations and code, in practice that support is
broken, and failed to build toke.obj:

The one case I looked at in detail, VS 2013 required an extra ; after
a conditional statement to accept the following declaration, for
example:

```
C:\Users\Tony\dev\perl\git>cl /c mixed.c
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

mixed.c
mixed.c(8) : error C2143: syntax error : missing ';' before 'const'
mixed.c(9) : error C2065: 'pend' : undeclared identifier
mixed.c(9) : error C2100: illegal indirection

C:\Users\Tony\dev\perl\git>type mixed.c
/* adapted from S_intuit_more() in toke.c.
   don't run this code
*/
int g(const char *p) {
  if (!p)
return (0);

  const char * const pend = p+1;
  return *pend;
}
```

regcomp.obj also failed to build due to the use of the "inline"
keyword in regcomp.h.  This is fairly trivially fixable but
inline is also C99.

Despite these build issues we haven't received any error reports for
VS2013, so I don't think it's worth re-working any mixed declarations
to support it.

It might be worth updating regcomp.h to use PERL_STATIC_INLINE
but that's out of scope for this commit.




[Perl/perl5] e07cc6: perlsec: minor taint edit

2023-11-06 Thread Hugo van der Sanden via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: e07cc68f8a7ef64c28e2cf0e1c6626cd26b9a877
  
https://github.com/Perl/perl5/commit/e07cc68f8a7ef64c28e2cf0e1c6626cd26b9a877
  Author: Hugo van der Sanden 
  Date:   2023-11-07 (Tue, 07 Nov 2023)

  Changed paths:
M pod/perlsec.pod

  Log Message:
  ---
  perlsec: minor taint edit

Paragraph signalling option to disable taint landed in the middle
of another sentence, breaking it.


  Commit: 6f40c0a02d0948dbb9de137db69fff2b1453
  
https://github.com/Perl/perl5/commit/6f40c0a02d0948dbb9de137db69fff2b1453
  Author: Hugo van der Sanden 
  Date:   2023-11-07 (Tue, 07 Nov 2023)

  Changed paths:
M pod/perlsec.pod

  Log Message:
  ---
  perlsec: clarify when preprocessor symbols are used

Readers of this document should not be required to know this.


Compare: https://github.com/Perl/perl5/compare/a23e475982a0...6f40c0a02d09


[Perl/perl5] 857715: win32: retire visual studio 2013 support

2023-11-06 Thread Tony Cook via perl5-changes
  Branch: refs/heads/smoke-me/tonyc/retire-vs-2013
  Home:   https://github.com/Perl/perl5
  Commit: 8577156faf0a3cfa4d7dac48390ee6de4ea4c6bd
  
https://github.com/Perl/perl5/commit/8577156faf0a3cfa4d7dac48390ee6de4ea4c6bd
  Author: Tony Cook 
  Date:   2023-11-07 (Tue, 07 Nov 2023)

  Changed paths:
M README.win32
M win32/GNUmakefile
M win32/Makefile

  Log Message:
  ---
  win32: retire visual studio 2013 support

I recently (tried) to test VS 2013 builds, but while vs2013 in theory
supports mixed declarations and code, in practice that support is
broken, and failed to build toke.obj:

The one case I looked at in detail, VS 2013 required an extra ; after
a conditional statement to accept the following declaration, for
example:

```
C:\Users\Tony\dev\perl\git>cl /c mixed.c
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

mixed.c
mixed.c(8) : error C2143: syntax error : missing ';' before 'const'
mixed.c(9) : error C2065: 'pend' : undeclared identifier
mixed.c(9) : error C2100: illegal indirection

C:\Users\Tony\dev\perl\git>type mixed.c
/* adapted from S_intuit_more() in toke.c.
   don't run this code
*/
int g(const char *p) {
  if (!p)
return (0);

  const char * const pend = p+1;
  return *pend;
}
```

regcomp.obj also failed to build due to the use of the "inline"
keyword in regcomp.h.  This is fairly trivially fixable but
inline is also C99.

Despite these build issues we haven't received any error reports for
VS2013, so I don't think it's worth re-working any mixed declarations
to support it.

It might be worth updating regcomp.h to use PERL_STATIC_INLINE
but that's out of scope for this commit.




[Perl/perl5] f4ed4e: sun/oracle workshop cc: use -O1 (same as -xO1) to ...

2023-11-06 Thread Tony Cook via perl5-changes
  Branch: refs/heads/smoke-me/tonyc/21535-workshop-cc-optimize
  Home:   https://github.com/Perl/perl5
  Commit: f4ed4ee9efbeb0f2ee1aa5573fd48cfb3d01fb90
  
https://github.com/Perl/perl5/commit/f4ed4ee9efbeb0f2ee1aa5573fd48cfb3d01fb90
  Author: Tony Cook 
  Date:   2023-11-06 (Mon, 06 Nov 2023)

  Changed paths:
M hints/linux.sh
M hints/solaris_2.sh

  Log Message:
  ---
  sun/oracle workshop cc: use -O1 (same as -xO1) to around probable bug

Fixes #21535


  Commit: 2d3e973d67e79f3d7518241e59f0894c6e33b453
  
https://github.com/Perl/perl5/commit/2d3e973d67e79f3d7518241e59f0894c6e33b453
  Author: Tony Cook 
  Date:   2023-11-06 (Mon, 06 Nov 2023)

  Changed paths:
M hints/linux.sh

  Log Message:
  ---
  sun/oracle workshop c99: allow for trailing zero size arrays

Encountered while testing -O1 with the workshop compiler on
Oracle Linux, follows the same test and workaround done in
hints/solaris_2.sh


  Commit: b17b9cce6719bfff950b80470a322cd0b7c37bce
  
https://github.com/Perl/perl5/commit/b17b9cce6719bfff950b80470a322cd0b7c37bce
  Author: Tony Cook 
  Date:   2023-11-06 (Mon, 06 Nov 2023)

  Changed paths:
M ext/POSIX/t/math.t

  Log Message:
  ---
  ext/POSIX/t/math.t: don't assume the sign of NaN

The test in Configure warns:

/* Note that whether the sign bit is on or off
 * for NaN depends on the CPU/FPU, and possibly
 * can be affected by the build toolchain.

but this test assumed that the default NaN was always positive,
but this isn't the case with the Sun/Oracle workshop cc, whether
on Oracle Linux or on Solaris.

copysign() is however well defined for NaN, so we can modify the
sign on NaN and test that with signbit().

Fixes #21533


  Commit: 9b6ba20c1abe4c44f98c0efe9fea3359cfb6e553
  
https://github.com/Perl/perl5/commit/9b6ba20c1abe4c44f98c0efe9fea3359cfb6e553
  Author: Tony Cook 
  Date:   2023-11-06 (Mon, 06 Nov 2023)

  Changed paths:
M ext/POSIX/t/math.t

  Log Message:
  ---
  POSIX: the fallback copysign() doesn't handle NaNs


  Commit: c0ae0468d11a419ab6ca88b351318731784d90d9
  
https://github.com/Perl/perl5/commit/c0ae0468d11a419ab6ca88b351318731784d90d9
  Author: Tony Cook 
  Date:   2023-11-06 (Mon, 06 Nov 2023)

  Changed paths:
M win32/config.vc

  Log Message:
  ---
  POSIX: MSVC really does have copysign

This is enabled in config.gc, and gcc builds were using only msvcrt
for a long time, so presumably MSVC 2013 which uses msvcrt also
supports it.  Later MSVC uses ucrt which definitely supports
copysign.


  Commit: 2a6624f3e7cf0b8f36029d1b226878a621b00180
  
https://github.com/Perl/perl5/commit/2a6624f3e7cf0b8f36029d1b226878a621b00180
  Author: Tony Cook 
  Date:   2023-11-06 (Mon, 06 Nov 2023)

  Changed paths:
M win32/config.vc

  Log Message:
  ---
  POSIX: MSVC really does have signbit()

But it appears that the fallback for Perl_signbit() in numeric.c
is broken when we've found a definition for Perl_fp_class_nzero().

When Perl_fp_class_nzero is defined, the fallback Perl_signbit()
simply returns that value, but Perl_fp_class_nzero() only returns
true when the number is negative zero, not for any negative number.

But C99 requires signbit(), so I don't think it's worth spending
any more time looking into this.  We might want to eliminate
Perl_signbit() from numeric.c, or try to fix it.


  Commit: 5414431705c5e008987a313a65ac62573e0862a7
  
https://github.com/Perl/perl5/commit/5414431705c5e008987a313a65ac62573e0862a7
  Author: Tony Cook 
  Date:   2023-11-06 (Mon, 06 Nov 2023)

  Changed paths:
M ext/POSIX/t/math.t
M win32/config.vc

  Log Message:
  ---
  POSIX: MSVC defines all of these

It also defines fpclassify(), but that's a more complex change
due to the classification macros in perl.h


Compare: https://github.com/Perl/perl5/compare/f4ed4ee9efbe%5E...5414431705c5