[sr #110872] m4_warn differs in various ways from its documentation

2023-12-15 Thread Zack Weinberg
Update of sr#110872 (group autoconf):

  Status:   Confirmed => In Progress

___

Follow-up Comment #1:

Candidate patch:
. 
Needs a portability fix and feedback from Automake maintainers before landing.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




Re: [sr #110554] AC_CONFIG_HEADERS doesn't work properly for files with Windows line-endings

2023-12-15 Thread Nick Bowler
On 2023-12-15 11:19, Zack Weinberg wrote:
[...]
> old non-GNU implementations of awk probably don't support using a
> regexp as the third argument to 'split'.  (I'm not 100% sure about
> this; the gawk manual is usually very good about pointing out
> portability issues but in this case it's ambiguous.

This fact is also explicitly mentioned in the Autoconf documentation[1]:

  In code portable to both traditional and modern Awk, FS must be a
  string containing just one ordinary character, and similarly for
  the field-separator argument to split.

The heirloom-tools package[2] includes a traditional awk with this
particular limitation.  This is a free software implementation (ported
from OpenSolaris) that can be installed on a modern GNU/Linux system.
It should be very similar to Solaris 10 /bin/awk:

  % echo abcdefg | heirloom-tools/5bin/awk '{ split($1, a, /c?e/); print a[2]; 
}'
  awk: syntax error near line 1

  % echo abcdefg | heirloom-tools/5bin/awk '{ split($1, a, "c?e"); print a[2]; 
}'
  defg

Even with AC_PROG_AWK, on ULTRIX it selects "nawk" which still does not
work with a regexp argument to split, but it does work if the argument
is a string which can be interpreted as a regexp:

  ultrix% echo abcdefg | nawk '{ split($1, a, /c?e/); print a[2]; }'
  [no output]

  ultrix% echo abcdefg | nawk '{ split($1, a, "c?e"); print a[2]; }'
  fg

[1] 
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/autoconf.html#Limitations-of-Usual-Tools
[2] https://heirloom.sourceforge.net/tools.html

Cheers,
  Nick



[sr #110554] AC_CONFIG_HEADERS doesn't work properly for files with Windows line-endings

2023-12-15 Thread Zack Weinberg
Update of sr#110554 (group autoconf):

  Status:   Confirmed => Ready For Test 

___

Follow-up Comment #1:

Should be fixed in
,
thanks for reporting.

Thanks also for providing a patch; it might have taken me hours to figure out
what to change otherwise.  I made a somewhat different change, though, because
your code could produce a config.h with _inconsistent_ line endings, and also
because old non-GNU implementations of awk probably don't support using a
regexp as the third argument to 'split'.  (I'm not 100% sure about this; the
gawk manual is usually very good about pointing out portability issues but in
this case it's ambiguous.  For code this fundamental I think it's best to play
safe.)

I don't have access to a development environment on a machine that uses CRLF
line endings.  I would appreciate it if you could test autoconf trunk in the
environment where you originally encountered the problem.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/