-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChangeLog
More file actions
4430 lines (3071 loc) · 153 KB
/
Copy pathChangeLog
File metadata and controls
4430 lines (3071 loc) · 153 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2026-06-15 Arnold D. Robbins <arnold@skeeve.com>
Thoroughly fix lint of plus on two strings with Op_elem_new.
* awk.h (OPCODE): Remove Op_lint_plus.
* awkgram.y (isnoeffect): Ditto.
(mk_binary): Just do Op_plus; lint check moved to interpret.h.
* eval.c (optypes): Remove Op_lint_plus.
* interpret.h (r_interpret): Remove Op_lint_plus case. Add lint
check to Op_plus case, rearranging code a bit.
* mpfr.c (mpg_interpret):. Add lint check to Op_plus case.
* profile.c (pprint): Remove Op_lint_plus.
2026-06-14 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (fmt_ok): Don't complain if no width or precision. Thanks
to Stephane Chazelas <stephane@chazelas.org> for the report.
* interpret.h (r_interpret): For Op_lint_plus, call
elem_new_to_scalar() on the values. Thanks to Hermann Peifer
for the report.
2026-05-26 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (mk_binary): Keep Doug McIlroy happy. Make division
by zero a lint warning. Applies to division and modulus.
* NEWS: Updated.
2026-05-25 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (mk_binary): Clean up code for when not optimizing.
Motivated by a bug report from Douglas McIlroy
<douglas.mcilroy@dartmouth.edu>.
(GRAMMAR): Add an additional lint check for plain print in a
BEGIN or END rule for when not optimizing. Thanks to the test
suite and GAWK_TEST_ARGS=-s.
2026-05-11 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_exp): Issue warning for ERANGE only if the
result is not zero. Thanks to joerg van den hoff
<veedeehjay@gmail.com> for the report.
2026-05-07 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (fmt_index): If OFMT or CONVFMT value is bad, always
warn. Using something like %sf for CONVFMT causes a core dump
due to infinite recursion, but mawk and nawk also fail this way.
It's a user error, we should not correct the value for them but
instead have them fix their code. Thanks to Michael D. Setzer II
<mikes@guam.net> for the report.
2026-04-28 Arnold D. Robbins <arnold@skeeve.com>
* str_array.c (STR_CHAIN_MAX): Document the change in size
back to 10 from 2025-02-16.
2026-04-27 Arnold D. Robbins <arnold@skeeve.com>
* array.c, builtin.c, cint_array.c, debug.c, field.c, int_array.c,
io.c, main.c: Remove casts to double in all calls to make_number().
There's a prototype in scope, the casts aren't needed.
2026-04-25 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2026-04-16 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
* main.c (usage): Make the text more generic so that I don't
have to keep changing test/badargs.ok upon every beta or
real release.
2026-04-15 Arnold D. Robbins <arnold@skeeve.com>
Remove intdiv0() code.
* configure.ac: Remove --enable-builtin-intdiv0 option.
* awkgram.y (tokentab): Remove entry for intdiv0.
(snode): Remove related code.
* builtin.c (do_intdiv): Removed.
* mpfr.c (do_mpfr_intdiv): Removed.
* NEWS: Updated.
2026-04-15 Arnold D. Robbins <arnold@skeeve.com>
* TODO: Updated.
2026-04-11 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h (r_interpret): For Op_unary_{plus,minus}, force
the top of the stack to be a number. This fixes issues with
Op_elem_new. See test/uplus2.awk. Thanks to
Lewis Hyatt <lhyatt@gmail.com> for the report.
* mpfr.c (mpg_interpret): Ditto.
2026-04-10 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_split): Refactor the logic a bit to make sure
that single-character regexs as the third argument are handled
correctly. Thanks to Ben Hoyt <benhoyt@gmail.com> for the
report and test case. New test case is splitany.
2026-04-07 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h (gawk_codeset): New macro.
2026-04-06 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_sub): Check for overflow in calculation of size
of result buffer by doing the math in 64 bits. This provides
a fatal message on 32 bit systems if overflow happens instead
of letting dynamic memory get corrupted and likely causing
a core dump. Thanks to Michał Majchrowicz <mmajchrowicz@afine.com>
for the report and fix.
2026-04-05 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2026-04-04 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_sub): Make `sofar' be size_t to avoid
integer overflows. Thanks to Michał Majchrowicz
<mmajchrowicz@afine.com> for the report.
* node.c (parse_escape): Change `i' to int64_t to avoid
overflows. Thanks to ASan with gcc -m32.
2026-04-03 Arnold D. Robbins <arnold@skeeve.com>
* io.c (do_getline_redir): Don't DEREF redir_exp too early.
Thanks to Michał Majchrowicz <mmajchrowicz@afine.com>
for the report.
2026-03-30 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_sub): Add error checking on multibyte char matching.
* interpret.h (r_interpret): Op_field_spec, use dupnode() instead
of UPREF on the pointer. Thanks to Marc Schönefeld
<marc.schoenefeld@gmx.org> for the report and test case.
2026-03-25 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Add macro for gawk_mb_cur_max.
Add codeset member to the API struct.
* gawkapi.c (init_ext_api): Initialize it.
* awk.h: Include <langinfo.h>.
* re.c (using_utf8): Use nl_langinfo() which is POSIX instead of
GNULIB localeinfo struct. This will help for when we eventually
nuke regex and dfa.
2026-03-22 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Note that <stdint.h> must be included.
(awk_string_t): Add wide char pointer and length.
(struct gawk_api): Add mb_cur_max member and functions
for converting m.b. string <--> wide string.
(mbstowcs, wcstombs): New macros.
* gawkapi.c (assign_string): Call force_wstr(). Copy in
wide string and length values to result.
(assign_number): Fix fatal error message.
(api_mbstowcs, api_wcstombs): New functions.
(api_impl): Add the functions and init mb_cur_max.
(init_ext_api): Init api_impl.mb_cur_max.
2026-03-15 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Futher API cleanup: comments fixed up, moved
api_destroy_array up with the rest of the array functions.
* gawkapi.c (api_impl): Moved api_destroy_array up with the
rest of the array functions.
2026-03-13 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2026-03-13 Arnold D. Robbins <arnold@skeeve.com>
Start updating the API.
* gawkapi.h (gawk_api_major_version, gawk_api_minor_version): Set to
5.0.
(do_flags): Now an int with bit flags. Various macros revised for
this.
(api_get_mpfr, api_get_mpz): Removed obsolete function pointers.
(get_mpfr_ptr, get_mpz_ptr): Removed obsolete macros.
* gawkapi.c (api_get_mpfr, api_get_mpz): Removed obsolete functions.
(api_impl): Remove braces around do_flag initializer, removed function
pointers for obsolete functions.
(init_ext_api, update_ext_api): Appropriate changes for do_flags.
2026-03-12 Arnold D. Robbins <arnold@skeeve.com>
All files updated, replacing the FSF address with a
link to the licenses: https://www.gnu.org/licenses/.
Thanks to Xose Vazquez Perez <xose.vazquez@gmail.com>
for pointing out the need.
2026-03-11 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2026-03-04 Arnold D. Robbins <arnold@skeeve.com>
Change AWKNUM to double everywhere.
* awk.h (AWKNUM): Remove macro definition.
* array.c, awkgram.y, builtin.c, cint_array.c, debug.c, eval.c,
field.c, floatcomp.c, int_array.c, interpret.h, io.c, main.c,
mpfr.c, node.c, printf.c, str_array.c: Global replacement of
AWKNUM with double.
2026-03-04 Arnold D. Robbins <arnold@skeeve.com>
Nuke the --re-interval option:
* awk.h (do_flag_values): Remove DO_INTERVALS, adjust the values.
(do_intervals): Remove macro definition.
* main.c (optab): Remove re-interval option.
(usage): Ditto.
(parse_args): Ditto: Adjust optlist and the switch cases.
* NEWS: Updated.
2026-03-04 Arnold D. Robbins <arnold@skeeve.com>
Nuke the --persist option:
* main.c (optab): Remove the option.
(parse_args): Remove the code that printed a fatal message.
* NEWS: Updated.
2026-03-04 Arnold D. Robbins <arnold@skeeve.com>
Nuke the --lint-old option:
* awk.h (do_flag_values): Remove DO_LINT_OLD, adjust the values.
(do_lint_old): Remove macro definitions.
* awkgram.y: Remove lint_old code and warnings.
(struct token): Remove NOT_OLD flag, adjust values.
(tokentab): Update flags values by removing NOT_OLD.
(yylex): Remove lint_old code and warnings.
* field.c (do_split): Remove reference to do_lint_old.
(set_FS): Ditto.
* main.c (optab): Remove lint-old option.
(usage): Ditto.
(parse_args): Ditto: Adjust optlist and the switch cases.
* node.c (parse_escape): Remove reference to do_lint_old.
2026-03-04 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2026-03-02 Arnold D. Robbins <arnold@skeeve.com>
* Checklist: Revisions.
2026-03-01 Weixie Cui <cuiweixie@gmail.com>
* array.c (make_aname): Use sizeof(char) instead of
sizeof(char *) when allocating memory for the aname
string buffer. The buffer holds characters, not
pointers, so the previous sizeof(char *) caused
over-allocation.
2026-02-27 Arnold D. Robbins <arnold@skeeve.com>
* buitin.c (do_sub): Pass searchflags to research in
loop over the whole line so that gensub()'s global works
with \N construct. Thanks to Koichi Murase <myoga.murase@gmail.com>
and Finn Steffens <finn.steffens@protonmail.com> for
reporting the bug.
2026-02-25 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_dump_node): Add print of gawk_mb_cur_max.
2026-02-22 Arnold D. Robbins <arnold@skeeve.com>
* 5.4.0: Release tar ball made.
2026-02-22 Arnold D. Robbins <arnold@skeeve.com>
* README: Updated.
2026-02-15 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2026-02-13 Arnold D. Robbins <arnold@skeeve.com>
* Checklist: Add more stuff.
2026-02-12 Arnold D. Robbins <arnold@skeeve.com>
* Checklist: Add more stuff.
* Makefile.am, Makefile.in, awk.h, awkgram.y, command.y,
debug.c, eval.c, ext.c, field.c, gawkapi.h, gawkmisc.c,
interpret.h, io.c, mpfr.c, node.c, nonposix.h, printf.c,
profile.c, replace.c, symbol.c: Update copyright year.
2026-02-10 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
* main.c (UPDATE_YEAR): Update to 2026.
2026-02-09 Arnold D. Robbins <arnold@skeeve.com>
Bug fix for untyped elements used in redirections.
Thanks to Ed Morton for the report.
* builtin.c (do_print): Call elem_new_to_scalar() on the redirection.
(do_getline_redir): Ditto.
2026-02-09 Arnold D. Robbins <arnold@skeeve.com>
* main.c (__dso_handle): Remove. PCC no longer needs it.
* printf.c (isinf): Remove macros, PCC now handles it okay.
2026-02-05 Arnold D. Robbins <arnold@skeeve.com>
* main.c (__dso_handle): Define if compiling with PCC.
* printf.c (isinf): For PCC undef it and define it as __builtin_isinf
which PCC supports.
2026-02-04 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Look for <sys/procctl.h> and <sys/sysctl.h>, and
for procctl() and sysctl(), on FreeBSD.
* NEWS: Updated.
2026-02-03 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am: For NetBSD 10, turn off ASLR via paxctl.
* NEWS: Updated.
2026-02-02 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
* re.c (regexflags2str): Remove declaration of function that
doesn't exist.
(resetup): Clean up the code a little.
(minrxcompflags2str, minrxexecflags2str): New functions.
2026-02-03 John E. Malmberg <wb8tyw@qsl.net>
* builtin.c (do_dump_node): Honor the HAVE_LONG_LONG_INT macro.
2026-01-28 John E. Malmberg <wb8tyw@qsl.net>
* ChangeLog: Spelling fixes
* custom.h: OpenVMS Posix is long gone.
2026-01-27 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2026-01-24 Arnold D. Robbins <arnold@skeeve.com>
* TODO: Updated.
2026-01-20 Arnold D. Robbins <arnold@skeeve.com>
* TODO: Updated.
2026-01-20 J. <thirdedition@gmx.net>
* configure.ac: Remove \ continuation in lists inside m4
constructs. Needed for MSYS2.
2026-01-17 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (posix_compare): Simplify further to always use
strcoll() everywhere but MinGW.
* NEWS: Updated. Only OpenBSD 7 works with PMA.
2026-01-16 Arnold D. Robbins <arnold@skeeve.com>
* printf.c (format_args): Revert fix of 2026-01-15.
* eval.c (posix_compare): For Cygwin, always uses strcoll().
2026-01-15 Corinna Vinschen <vinschen@redhat.com>
UTF-8 and GB18030 allow 4 byte multibyte sequences which
have to be converted to surrogate pairs on systems with
wchar_t == UTF-16. That only affects Cygwin for now, given
AIX is ignored and native Windows is handled separately.
This affects the printf() functions because the character and byte
counting in mbc_char_count() and mbc_byte_count() can't handle
characters yet which have to be converted to surrogate pairs.
First of all, both functions do not expect the mbstate_t to be
in a shift state after it read the first character. However, this
is essential to keep track of the full character during surrogate
handling. When the code restarts reading the string from the
beginning for counting, it neglects to reset the shift state,
so the next read encounters an invalid character sequence. So make
sure to reset the shift state when reading from the beginning.
For Cygwin:
Add code to mbc_char_count() to count a surrogate pair as a single
character, not as two characters.
Add code to mbc_byte_count() to handle only a full surrogate as a
full character.
2026-01-15 Arnold D. Robbins <arnold@skeeve.com>
* printf.c (format_args): For %c, check for -2 return value
from c32rtomb().
2026-01-14 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_dump_node): Change %zd to %zu.
For MB_CUR_MAX, cast to int; helps on Cygwin.
2026-01-12 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_substr): Add casts to silence clang warnings.
* node.c (r_format_val): Ditto.
* main.c (load_procinfo): Ditto.
(initfds): Change use of newfd to silence set but not used warning.
2026-01-09 Arnold D. Robbins <arnold@skeeve.com>
* mpfr.c (force_mpnum): Use bool instead of int for parameters.
(mpg_force_number): Sync some with r_force_number. Accept
non-decimal data if --posix, as in r_force_number. Thanks to
Jason C. Kwan for the report.
2026-01-06 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Edited.
2026-01-04 Arnold D. Robbins <arnold@skeeve.com>
* bootstrap.sh: No need to touch doc/gawk.texi. Add touch
of pc/Makefile.tst.
2026-01-04 Eli Zaretskii <eliz@gnu.org>
* NEWS: Updated with info about UTF-8 on Windows.
2025-12-30 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2025-12-30 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Style edit: POSIX in all caps.
* main.c: Style edits: No space before parens in function calls.
* node.c (parse_escape): Move memset() of mbs to outside ifdefs.
Factors out duplicate code.
2025-12-28 Eli Zaretskii <eliz@gnu.org>
* awk.h: Remove MinGW stuff that is no longer needed.
* custom.h [__MINGW32__]: Add redirections for char32_t functions
and their prototypes. Override MB_CUR_MAX with a MinGW-specific
function. Add prototypes and redirections for stdio functions to
work around a bug in MSVCRT.
* gawkmisc.c [__MINGW32__]: Include pc/mbc32.c.
* main.c (main) [__MINGW32__]: Adjust the value of gawk_mb_cur_max
when the locale changes.
* node.c: Remove MinGW-specific code, which is not longer needed.
* nonposix.h: Add prototype of 'mingw_using_utf8'.
* printf.c: Fix a typo: wcrtomb should not be called directly, but,
if needed, via c32rtomb.
* profile.c: Avoid compiler warnings about functions that are
unused when SIGHUP and SIGUSR1 are not defined.
* replace.c [__MINGW32__ && !_UCRT]: Include stdio-consolesafe.c
to work around MSVCRT bugs when writing multibyte characters to
the console.
2025-12-28 Arnold D. Robbins <arnold@skeeve.com>
* TODO: Updated.
2025-12-27 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (yylex): Add support for hexadecimal floating point.
* builtin.c (nondec2awknum): Improve hex floating point support.
2025-12-24 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: New option, --enable-O3 to use -O3 at compile
time. This restores the default of -O2.
* NEWS: Updated.
Unrelated:
* Checklist: Updated with more items.
2025-12-23 Eli Zaretskii <eliz@gnu.org>
* awk.h [_UCRT]: Use MinGW64-provided <uchar.h> when possible.
(char32_t): Use the same typedef as in uchar.h. Include
<stdint.h> that's required for uint_least32_t.
2025-12-23 Arnold D. Robbins <arnold@skeeve.com>
* bootstrap.sh: Be smarter about touching the doc/*.info files.
2025-12-22 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Fixes for systems without uchar.h.
2025-12-22 Arnold D. Robbins <arnold@skeeve.com>
Switch to using the char32_t and associated routines.
* configure.ac: Add checks for uchar.h, mbrtoc32(), c32rtomb().
* awk.h: Add declarations and macros, based on configuration.
(NODE, wstrstr, wcasestrstr): Switch to char32_t from wchar_t.
* builtin.c: Ditto, use mbrtoc32(), across the board.
* eval.c: Ditto, use c32slen(), c32scoll() in posix_compare().
* interpret.h: Use char32_t.
* node.c: Use char32_t and associated functions.
* printf.c: Ditto.
2025-12-18 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Add a pragma for z/OS so that enum sizes are the same
size as int. Prevents a core dump in the randtest test. Much
thanks to Daniel Richard G. <skunk@iskunk.org> for the fix.
2025-12-17 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_match): If $0 was the regex, after unrefing
tre->re_exp, set it to NULL so that it won't get unref'ed
a second time. Thanks to valgrind.
Unrelated:
* node.c (parse_escape): Set type of `i' to long. Avoids
undefined behavior warning from UBSan.
2025-12-16 Arnold D. Robbins <arnold@skeeve.com>
* awk.h, configure.ac, main.c, re.c, version.c: Minor edits
before merging into master.
2025-12-15 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_dump_node): Add additional information, fix
print param_cnt member.
Unrelated:
* configure.ac: Add strftime back to the list of functions
we search for. It's needed on MinGW.
* replace.c: Include missing_d/strftime.c if needed, along
with MinGW stuff. Thanks to Eli Zaretskii <eliz@gnu.org>.
Unrelated:
* TODO: Updated.
2025-12-12 Eli Zaretskii <eliz@gnu.org>
* awk.h: Add declaration for timegm if HAVE_TIMEGM not defined.
Needed for MinGW.
* io.c (wait_any_block_signals): Add ifdefs as needed for MinGW.
(file_can_timeout): Ditto.
2025-12-12 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_dump_node): Add an additional ifdef for MPFR.
2025-12-11 Arnold D. Robbins <arnold@skeeve.com>
* debug.c (CHECK_PROG_RUNNING): Add file, line number and function
names to error message.
(serialize_list): Move history related variables and code into
#ifdefs so that things compile without readline.
2025-12-10 Arnold D. Robbins <arnold@skeeve.com>
Add a function to dump the NODE structure. Should have done
this ages ago.
* awk.h (do_dump_node): Declare the function.
* builtin.c (do_dump_node): New function.
* awkgram.y (tokentab): Add entry for _dump_node(). Note the "_".
2025-12-09 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated with info about MinRX.
2025-12-09 Arnold D. Robbins <arnold@skeeve.com>
* mpfr.c (mpg_mod): Keep only comments relevant to compatibility.
And refer to the test.
* builtin.c (do_intdiv): Fix typos in a comment.
* mpfr.c (do_mpfr_intdiv): Ditto.
Thanks to Nethox <nethox+awk@gmail.com> for the patch.
2025-12-06 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: If using gettimeofday(), include <sys/time.h>.
This is helpful on old macOS, at least.
2025-11-30 Arnold D. Robbins <arnold@skeeve.com>
Improve the timeout check to be made when the IOP is created
instead of on every record read.
* awk.h (IOBUF): Add a can_timeout member.
* io.c (get_a_record): Use it instead of calling file_can_timeout().
(file_can_timeout): Adjust to take fd and mode arguments.
(iop_alloc): Set the can_timeout member by calling file_can_timeout.
2025-11-24 Arnold D. Robbins <arnold@skeeve.com>
* README: Updated some more.
2025-11-22 Arnold D. Robbins <arnold@skeeve.com>
Improve raw I/O speed by not checking for a timeout
when there's no need. Issue noticed during profiling
of something unrelated.
* io.c (file_can_timeout): New routine. Returns true if an
input file is one that can timeout. Regular files cannot.
(get_a_record): Use it.
2025-11-16 Arnold D. Robbins <arnold@skeeve.com>
* io.c (inetfile): Issue a warning if udp is used. It's
now obsolete.
* NEWS: Updated.
2025-11-04 Arnold D. Robbins <arnold@skeeve.com>
Continue the cleanup:
* configure.ac: Don't look for system().
* replace.c: Don't include missing_d/system.c. It was for DJGPP
which is not supported anymore.
* custom.h: Remove the bit for QNX. Improve the declaration of
strsignal().
2025-11-03 Arnold D. Robbins <arnold@skeeve.com>
Considerably simplify use of replacement functions. Many of the
replacement functions are for routines that now widely standard,
so we assume they're available.
* Makefile.am (base_sources): Remove protos.h.
* protos.h: Remove this file.
* awk.h: Don't include protos.h. Don't do gawk_strtod() stuff.
* configure.ac: Remove checks for a whole bunch of standard functions.
Remove AC_FUNC_MKTIME check.
* custom.h: Remove old checks for HP/UX and macOS.
* replace.c: Remove checks and includes of files that are no
longer needed.
2025-10-31 Arnold D. Robbins <arnold@skeeve.com>
After discussion with Nelson Beebe, allow hexadecimal
floating point for strtonum() and --non-decimal-data.
NOTE: NOT in program source code! (At least, not yet. Sigh.)
* NEWS: Updated.
* builtin.c (nondec2awknum): Revise logic.
* mpfr.c (force_mpnum): Ditto.
2025-10-29 Arnold D. Robbins <arnold@skeeve.com>
* re.c (make_regexp): Remove assertion that string is zero
terminated. It isn't always. Instead, save and restore the
character past the value of `len'. This required making the
first parameter not be const anymore. Thanks to Ben Hoyt
<benhoyt@gmail.com> for the report.
* awk.k (make_regexp): Adjust declaration.
2025-10-28 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y: Remove never-documented support for tawk extension
`delete(a)' and lint warnings for regexp modifiers. Tawk is dead,
it's time to bury the corpse.
2025-10-27 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h (r_interpret): Op_push_arg_untyped: Don't issue
lint warning for untyped variables, since isarray() and typeof()
don't change the type of the parameter. Thanks to
Greg Minshall <minshall@umich.edu> for the suggestion.
2025-10-25 Arnold D. Robbins <arnold@skeeve.com>
* field.c (do_split, do_patsplit): Use do_lint_extensions before
warning about extensions.
(set_FPAT): Clean up a lint warning.
* io.c (set_RS): Ditto.
2025-10-23 Arnold D. Robbins <arnold@skeeve.com>
* field.c (do_split): If someone passed a Node_elem_new
or subarray as the second argument to split(), issue a
lint warning. Thanks to Hermann Peifer for the suggestion.
(do_patsplit): Add the same warning.
2025-10-22 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h (r_interpret): For Op_sub_array, don't warn
about using an uninitialized element, as there is no
way to create the parent of a subarray first. Thanks to
Greg Minshall <minshall@umich.edu> for the report.
Unrelated:
* Checklist: Add an item to run the test suite with MPFR.
2025-10-19 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Don't disable assertions anymore. They provide
value, and on modern systems don't affect performance.
* NEWS: Updated.
2025-10-19 Arnold D. Robbins <arnold@skeeve.com>
* re.c (re_update): Revert previous fix, it didn't do the trick.
* builtin.c (do_match): If someone passed $0 as the second
argument, deref it. It's a special case, but it keeps the
assertions happy.
Thanks to Eli Zaretskii <eliz@gnu.org> for the report.
2025-10-17 Arnold D. Robbins <arnold@skeeve.com>
Fix a bug when match() is called with $0 as the second argument.
The bug only showed up with assertions enabled. At the same time,
add a warning if a regexp constant is used as the first argument.
Thanks to Daniel David Goren <danieldavidgoren@gmail.com> for
the report.
* awkgram.y (snode): For do_match, add a warning if the first
argument is a regexp constant.
* re.c (re_update): Unref the original text of the regexp
if the copy is different from it.
Unrelated:
* mpfr.c (mpg_mod): Use mpz_tdiv_r() instead of mpz_tdiv_qr()
to simplify the code. Suggested by Jason C. Kwan on the
help-gawk list.
2025-10-04 Arnold D. Robbins <arnold@skeeve.com>
* printf.c (format_args): Fix call to fatal() to not have "fatal:"
in it.
2025-09-27 Arnold D. Robbins <arnold@skeeve.com>
Fix configure --disable-extensions. Thanks to
Frank Busse <f.busse@imperial.ac.uk> for the report.
* configure.ac: When modifying the Makefile for different CFLAGS,
use test -f to make sure that one is there.
* ext.c (init_extensions_list): Add dummy version for when extensions
are disabled.
(load_ext): Update the function argument list for the dummy
version to match the real one and the declaration in awk.h.
* Checklist: Add an item to check `configure --disable-extensions'
so that this won't happen again.
2025-09-01 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Fix spacing / indentation.
* builtin.c (do_typeof): Memory leak fix for Node_elem_new. This
showed up with valgrind in debug build on the test/elemnew4.awk
file.
* builtin.c: Move commented out main() test program for add_thousands()
to ...
* printf.c: ... here from builtin.c.
2025-07-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
Add #ifdef'ed out patch to io.c to use a hashtable to store pipe
pids to fix a problem with a docker container that defaulted to
a ulimit of a billion open fds.
* io.c (write_pipe): If hashing, add a next field.
(save_pipe): New function to add a pipe to the hash table.
(gawk_popen_write): If hashing, allocate index of PIPE_HASH_SIZE
instead of getdtablesize(), and use save_pipe to store the pipe info
instead of sticking it directly into the open_pipes array.
(gawk_popen_write_close): If hashing, search the bucket list
for a matching process. If the match is not at the head of the
linked list, remove it from the list and free it.
2025-07-29 Arnold D. Robbins <arnold@skeeve.com>
Make gawk's system() function smarter. It has to ignore SIGINT
and SIGQUIT and block SIGCHLD (per POSIX for the C system()
function.) Thanks to Finn Magnusson <finnmag@yahoo.com> for
the report. The test case was:
gawk 'BEGIN { system("cat"); print "\n1" }'
Then immediately interrupt the "cat" with a Control-C.
Older versions of gawk that used the C library system() would
still print the "1". Gawk 5.3.1 would not. These changes
restore the old behavior.
Note that different versions of awk do different things
in this test case. BWK awk does print the "1", mawk does not.
* io.c (wait_any): Now has just the code to do the wait and
update the status.
* io.c (wait_any_block_signals): This was originally wait_any().
Simplified it by having just the signal handling here and making
a call to wait_any().
* builtin.c (gawk_system): Added signal handling code to
ignore/block signals in the parent before the fork, restore
things in the child before the exec, and restore them in
the parent after calling wait_any().
2025-07-29 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (emalloc_real, ezalloc_real, erealloc_real): Use %zu
in the error message instead of %ld and casting to long.
2025-07-28 Arnold D. Robbins <arnold@skeeve.com>
Rationalize do_traditional throughout the code base:
1. Bring things into sync with current BWK awk.
2. Change `do_posix || do_traditional' tests to just `do_traditional'
since --posix automatically also turns on do_traditional.
* builtin.c (do_system): Remove old code that divided the
exit status by 256 if do_traditional. BWK awk no longer
does that.
* ext.c (load_ext): Simplify check for do_traditional.
* field.c (do_split): Ditto.
* main.c (is_std_var): Ditto.
* re.c (make_regexp): Ditto.
* symbol.c (lookup): Ditto.
* io.c (set_RS): Change check from do_traditional to do_posix
in case where RS->stlen > 1.
2025-07-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
* io.c (redirect): Don't issue a lint complaint if the
redirect string is a STRNUM, because a filename could be
numeric, and that shouldn't be flagged by lint if it came
from user input.
2025-07-22 Arnold D. Robbins <arnold@skeeve.com>
* main.c (check_pma_security): #ifdef out the whole function if
PMA is not enabled. Also the declaration. Avoids compiler warnings.
(enable_pma): Simplify the code some.
2025-07-22 Nick Alcock <nick.alcock@oracle.com>
* main.c (enable_pma): Return false as default if PMA is
not enabled. Otherwise the test suite breaks if gawk is
built with `configure --disable-pma'.
2025-07-14 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_length): As length(array) is now part of POSIX,
remove checks and warnings.
* NEWS: Updated with this info.
2025-07-10 Arnold D. Robbins <arnold@skeeve.com>
* ext.c (load_ext): Allow a magic environment variable to allow
loading of extensions even if --traditional / --posix.
Mainly for testing purposes.
2025-07-10 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (fixtype): Take Node_elem_new into account.
Bug report from Douglas Nelson, nelson@msu.edu.
2025-06-13 Jim Mellander <jmellander@gmail.com>
* builtin.c (do_srand): Change casts of seed values to
unsigned long. Avoids some overflow problems.
2025-06-03 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated w.r.t. PMA usage changes.
* awk.h (load_ext): Change declaration, new additional parameter.
(init_extension_list): Add declaration.
(extension_list): Add declaration.
(version_string, persist_file): Add declarations.
* awkgram.y (load_library): Add s->src in call to load_ext().
* ext.c (extension_list): Maintain a list of loaded extensions
when using PMA so can check if an extension is loaded from
a different path.
(search_ext_list, init_extension_list): New functions.
(extension_list): Add definition.
(load_ext): Add additional argument `name'. Search the extension
list if PMA.
(make_builtin): If PMA and found the function already installed,
update its function pointer and return true. Returning true
avoids a warning.
* main.c (main): Update call to load_ext().
(persist_file): New global variable.
* symbol.c (struct root_pointers): Add ext_list and version_string
members.
(init_symbol_table): For first time, call init_extension_list,
save it and the version_string. Restore on second time and
check version.
2025-06-01 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (using_pma): Removed. We already have
using_persistent_malloc.
* main.h (using_pma): Ditto. Adjust uses.
* ext.c (load_ext): Use using_persistent_malloc.
2025-05-28 Arnold D. Robbins <arnold@skeeve.com>
* io.c (two_way_open): Fix direction in non-MinGW call
to os_close_on_exec().
2025-05-23 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h (gawk_api_minor_version): Increased to 1, because
of the previous change.
* NEWS: Updated.
2025-05-22 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.c (api_set_array_element): Ensure that the new index
is indeed a string. Thanks to SBP <seirios@ik.me> for the report.
2025-05-22 Arnold D. Robbins <arnold@skeeve.com>
Persistent memory and extension functions don't mix. Make
it a fatal error that gawk catches instead of weird errors
and core dumps. Issue reported by "Stan Marsh" (sic)
<gazelle@xmission.com>.
* awk.h (using_pma): New variable, add extern declaration.
* ext.c (load_ext): If using_pma, fatal message.
* main.c (using_pma): New variable, add definition.
(enable_pma): Set it.
2025-05-18 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (update_ERRNO_int, update_ERRNO_string, unset_ERRNO):
If do_traditional, return early.
* io.c: As needed, for calls to the above, remove test for
! do_traditional. The code was not being consistent about
always checking. Thanks to Andrew Schorr for pointing out
the issue.
2025-05-16 Arnold D. Robbins <arnold@skeeve.com>
Make sure all non-standard variables are unavailable
with --traditional. Thanks to Andrew Schorr for the push.
* io.c (get_a_record): Don't mess with RT if do_traditional.
* main.c (init_vars): Don't install non-standard variables.
* NEWS: Updated.
2025-05-14 Arnold D. Robbins <arnold@skeeve.com>
* awk.h [RE_NEED_SUB]: New flag for if need submatch info.
* builtin.c (do_sub, do_match): Use it when needed.
* re.c (research): For MinRX, adjust match_count value based
on RE_NEED_SUB and RE_NEED_START. Allows for eventual
optimizations within MinRX.
2025-05-06 Arnold D. Robbins <arnold@skeeve.com>
* re.c (research): Undo previous change. MINRX_REG_NOSUB
is a flag for compiling the regex, not execing it. :-(
In gawk, we don't know at regex compile time if we will
need the subpatterns or not. Oh well.
2025-04-28 Arnold D. Robbins <arnold@skeeve.com>
* re.c (research): If not need_start, add MINRX_REG_NOSUB
to the flags. In preparation for when MinRX implements
that flag.
2025-04-08 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Check for posix_spawnp() also, for older
macOS systems.
2025-04-06 Arnold D. Robbins <arnold@skeeve.com>
* re.c (make_regexp): Add MINRX_REG_MINDISABLE for traditional awk.
2025-04-02 Arnold D. Robbins <arnold@skeeve.com>
* README: Version adjusted for release.
* configure.ac: Ditto.
* 5.3.2: Release tar made.
2025-03-27 Arnold D. Robbins <arnold@skeeve.com>