]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix test-as-const-jmp_buf-ssp.c generation on gnu-i386
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 3 Dec 2018 13:40:48 +0000 (14:40 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 3 Dec 2018 13:40:48 +0000 (14:40 +0100)
hurd's jmp_buf-ssp.sym does not define any symbol.
scripts/gen-as-const.py currently was emitting an empty line in that
case, and the gawk invocation was prepending "asconst_" to it, ending up
with:

.../build/glibc/setjmp/test-as-const-jmp_buf-ssp.c:1:2: error: expected « = », « , », « ; », « asm » or
« __attribute__ » at end of input
    1 |  asconst_
      |  ^~~~~~~~

        * scripts/gen-as-const.py (main): Avoid emitting empty line when
        there is no element in `consts'.

ChangeLog
scripts/gen-as-const.py

index 98c7ac761ea19727b1c12ee833e1786992e40f4b..030c567a7793057a88b2bd761186527a425f4250 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-12-03  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+       * scripts/gen-as-const.py (main): Avoid emitting empty line when
+       there is no element in `consts'.
+
 2018-12-01  Florian Weimer  <fweimer@redhat.com>
 
        * support/support_capture_subprocess.c
index b7a5744bb192dd67853cdf3426ded3f216d3e310..cabf401ed15e836713fd8a0403797776d1f026ae 100644 (file)
@@ -153,7 +153,7 @@ def main():
         print(gen_test(sym_data))
     else:
         consts = compute_c_consts(sym_data, args.cc)
-        print('\n'.join('#define %s %s' % c for c in sorted(consts.items())))
+        print(''.join('#define %s %s\n' % c for c in sorted(consts.items())), end='')
 
 if __name__ == '__main__':
     main()