File: 0005-aclocal-declare-function-prototypes-do-not-use-in-fu.patch

package info (click to toggle)
automake1.11 1%3A1.11.6-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 10,280 kB
  • sloc: sh: 35,059; perl: 10,697; makefile: 946; ansic: 496
file content (133 lines) | stat: -rw-r--r-- 3,911 bytes parent folder | download | duplicates (3)
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
From: Stefano Lattarini <stefano.lattarini@gmail.com>
Date: Mon, 28 May 2012 13:32:03 +0200
Subject: aclocal: declare function prototypes,
 do not use '&' in function calls

This change will also fix automake bug#11543 (from a report by Matt
Burgess).

* aclocal.in: Declare prototypes for almost all functions early, before
any actual function definition (but omit the prototype for the dynamically
generated '&search' function).  Add prototypes to any function definition.
Remove '&' from function invocations (i.e., simply use "func(ARGS..)"
instead of "&func(ARGS...)").
* THANKS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
---
 THANKS     |  1 +
 aclocal.in | 42 ++++++++++++++++++++++++++++++++++--------
 2 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/THANKS b/THANKS
index e584fa7..ff0608c 100644
--- a/THANKS
+++ b/THANKS
@@ -231,6 +231,7 @@ Martin Waitz		tali@admingilde.org
 Mathias Doreille	doreille@smr.ch
 Mathias Froehlich	M.Froehlich@science-computing.de
 Mathias Hasselmann	mathias.hasselmann@gmx.de
+Matt Burgess		matthew@linuxfromscratch.org
 Matt Leach		mleach@cygnus.com
 Matthew D. Langston	langston@SLAC.Stanford.EDU
 Matthias Andree		matthias.andree@gmx.de
diff --git a/aclocal.in b/aclocal.in
index 4764379..2f56b44 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -152,8 +152,34 @@ my $erase_me;
 
 ################################################################
 
+# Prototypes for all subroutines.
+
+sub unlink_tmp (;$);
+sub xmkdir_p ($);
+sub check_acinclude ();
+sub reset_maps ();
+sub install_file ($$);
+sub list_compare (address@hidden@);
+sub scan_m4_dirs ($@);
+sub scan_m4_files ();
+sub add_macro ($);
+sub scan_configure_dep ($);
+sub add_file ($);
+sub scan_file ($$$);
+sub strip_redundant_includes (%);
+sub trace_used_macros ();
+sub scan_configure ();
+sub write_aclocal ($@);
+sub usage ($);
+sub version ();
+sub handle_acdir_option ($$);
+sub parse_arguments ();
+sub parse_ACLOCAL_PATH ();
+
+################################################################
+
 # Erase temporary file ERASE_ME.  Handle signals.
-sub unlink_tmp
+sub unlink_tmp (;$)
 {
   my ($sig) = @_;
 
@@ -351,7 +377,7 @@ sub scan_m4_dirs ($@)
 	  next if $file eq 'aclocal.m4';
 
 	  my $fullfile = File::Spec->canonpath ("$m4dir/$file");
-	    &scan_file ($type, $fullfile, 'aclocal');
+	  scan_file ($type, $fullfile, 'aclocal');
 	}
       closedir (DIR);
     }
@@ -362,12 +388,12 @@ sub scan_m4_files ()
 {
   # First, scan configure.ac.  It may contain macro definitions,
   # or may include other files that define macros.
-  &scan_file (FT_USER, $configure_ac, 'aclocal');
+  scan_file (FT_USER, $configure_ac, 'aclocal');
 
   # Then, scan acinclude.m4 if it exists.
   if (-f 'acinclude.m4')
     {
-      &scan_file (FT_USER, 'acinclude.m4', 'aclocal');
+      scan_file (FT_USER, 'acinclude.m4', 'aclocal');
     }
 
   # Finally, scan all files in our search paths.
@@ -381,7 +407,7 @@ sub scan_m4_files ()
   my $search = "sub search {\nmy \$found = 0;\n";
   foreach my $key (reverse sort keys %map)
     {
-      $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { & add_macro ("' . $key
+      $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { add_macro ("' . $key
 		  . '"); $found = 1; }' . "\n");
     }
   $search .= "return \$found;\n};\n";
@@ -404,7 +430,7 @@ sub add_macro ($)
 
   verb "saw macro $macro";
   $macro_seen{$macro} = 1;
-  &add_file ($map{$macro});
+  add_file ($map{$macro});
 }
 
 # scan_configure_dep ($file)
@@ -466,7 +492,7 @@ sub scan_configure_dep ($)
     }
 
   add_macro ($_) foreach (@rlist);
-  &scan_configure_dep ($_) foreach @ilist;
+  scan_configure_dep ($_) foreach @ilist;
 }
 
 # add_file ($FILE)
@@ -933,7 +959,7 @@ General help using GNU software: <http://www.gnu.org/gethelp/>.
 }
 
 # Print version and exit.
-sub version()
+sub version ()
 {
   print <<EOF;
 aclocal (GNU $PACKAGE) $VERSION