summaryrefslogtreecommitdiffstats
path: root/package/gengetopt
diff options
context:
space:
mode:
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>2017-02-03 23:02:48 +0100
committerPeter Korsgaard <peter@korsgaard.com>2017-02-04 09:25:43 +0100
commit774e7b0bfdc875a168348f5b92728e566ead2eb3 (patch)
treea2abb2a8720af850d35031f7205c388c1b2e53f5 /package/gengetopt
parentee90313c648b7e0eb28ffad3a458f3e18bab23d7 (diff)
downloadbuildroot-774e7b0bfdc875a168348f5b92728e566ead2eb3.tar.gz
buildroot-774e7b0bfdc875a168348f5b92728e566ead2eb3.zip
gengetopt: add patch to fix compilation warnings in generated code
getgetopt generates code that causes compilation warnings in current versions of gcc. If gengetopt is used for programs that set -Werror during compilation, these compilation warnings become real problems. Unfortunately, the gengetopt project seems dead for several years now. Last release dates back to 2012. There is an open bug for this problem [1], with a proposed patch, but no response from the maintainers. Apply the patch from the bug report to fix the problem. [1] http://savannah.gnu.org/bugs/?40243 Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/gengetopt')
-rw-r--r--package/gengetopt/0001-fix-compilation-warnings-in-generated-code.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/package/gengetopt/0001-fix-compilation-warnings-in-generated-code.patch b/package/gengetopt/0001-fix-compilation-warnings-in-generated-code.patch
new file mode 100644
index 0000000000..88961e6690
--- /dev/null
+++ b/package/gengetopt/0001-fix-compilation-warnings-in-generated-code.patch
@@ -0,0 +1,65 @@
+Fix compilation warnings in generated code
+
+Patch taken from open bug report http://savannah.gnu.org/bugs/?40243
+(project gengetopt seems to be dead; no hope for a new release soon)
+
+Imported by Philippe Mariman.
+This description by Thomas De Schampheleire.
+
+Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
+
+Index: gengetopt-2.22.6/src/skels/c_source.cc
+===================================================================
+--- gengetopt-2.22.6.orig/src/skels/c_source.cc 2012-11-07 20:58:29.000000000 +0100
++++ gengetopt-2.22.6/src/skels/c_source.cc 2014-11-20 12:05:02.597527761 +0100
+@@ -2424,9 +2424,12 @@
+ stream << " FIX_UNUSED (field);";
+ stream << "\n";
+ stream << indent_str;
++ stream << " FIX_UNUSED (stop_char);";
++ stream << "\n";
++ stream << indent_str;
++ stream << " FIX_UNUSED (val);";
+ stream << "\n";
+ stream << indent_str;
+- stream << " stop_char = 0;";
+ stream << "\n";
+ stream << indent_str;
+ stream << " found = 0;";
+@@ -3981,6 +3984,12 @@
+ stream << "\n";
+ stream << indent_str;
+ }
++ else
++ {
++ stream << " FIX_UNUSED (check_required);";
++ stream << "\n";
++ stream << indent_str;
++ }
+ stream << "\n";
+ stream << indent_str;
+ indent = 2;
+Index: gengetopt-2.22.6/src/skels/c_source.h_skel
+===================================================================
+--- gengetopt-2.22.6.orig/src/skels/c_source.h_skel 2012-11-02 18:43:24.000000000 +0100
++++ gengetopt-2.22.6/src/skels/c_source.h_skel 2014-11-20 12:05:22.501528424 +0100
+@@ -767,8 +767,9 @@
+ char **string_field;
+ @ENDIF@
+ FIX_UNUSED (field);
++ FIX_UNUSED (stop_char);
++ FIX_UNUSED (val);
+
+- stop_char = 0;
+ found = 0;
+
+ if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given)))
+@@ -1327,6 +1328,8 @@
+ {
+ error_occurred += @parser_name@_required2 (args_info, argv[0], additional_error);
+ }
++@ELSE@
++ FIX_UNUSED (check_required);
+ @ENDIF@
+
+ @parser_name@_release (&local_args_info);
OpenPOWER on IntegriCloud