From 2ee84eaa8570bdbcf202e68ee0dc0ce2280dfa65fc3e3acbed1a73ae0d1c604b Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 11 Jun 2015 09:40:20 +0000 Subject: [PATCH 1/2] Accepting request 311564 from home:Andreas_Schwab:Factory - keyword-identifier.patch: rename identifier conflicting with keyword OBS-URL: https://build.opensuse.org/request/show/311564 OBS-URL: https://build.opensuse.org/package/show/devel:tools/cdecl?expand=0&rev=6 --- cdecl.changes | 5 ++++ cdecl.spec | 2 ++ keyword-identifier.patch | 55 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 keyword-identifier.patch diff --git a/cdecl.changes b/cdecl.changes index e9c8ba3..830e7f9 100644 --- a/cdecl.changes +++ b/cdecl.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jun 11 09:08:54 UTC 2015 - schwab@suse.de + +- keyword-identifier.patch: rename identifier conflicting with keyword + ------------------------------------------------------------------- Mon Feb 13 10:44:51 UTC 2012 - coolo@suse.com diff --git a/cdecl.spec b/cdecl.spec index 904b9fb..7b60b05 100644 --- a/cdecl.spec +++ b/cdecl.spec @@ -27,6 +27,7 @@ License: SUSE-Public-Domain Source: %name-%version.tar.xz Patch1: %name-2.5-deb11.diff +Patch2: keyword-identifier.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison flex readline-devel xz @@ -42,6 +43,7 @@ library. %prep %setup %patch -P 1 -p1 +%patch2 -p1 %build make CFLAGS="%optflags -DUSE_READLINE -DOLD_READLINE" %{?_smp_mflags}; diff --git a/keyword-identifier.patch b/keyword-identifier.patch new file mode 100644 index 0000000..ec496a3 --- /dev/null +++ b/keyword-identifier.patch @@ -0,0 +1,55 @@ +Index: cdecl-2.5/cdecl.c +=================================================================== +--- cdecl-2.5.orig/cdecl.c ++++ cdecl-2.5/cdecl.c +@@ -241,7 +241,7 @@ struct + /* for unsupported combinations of types. */ + void mbcheck() + { +- register int i, j, restrict; ++ register int i, j, restriction; + char *t1, *t2; + + /* Loop through the types */ +@@ -258,26 +258,26 @@ void mbcheck() + if (!(modbits & crosstypes[j].bit)) + continue; + /* check the type of restriction */ +- restrict = crosscheck[i][j]; +- if (restrict == ALWAYS) ++ restriction = crosscheck[i][j]; ++ if (restriction == ALWAYS) + continue; + t1 = crosstypes[i].name; + t2 = crosstypes[j].name; +- if (restrict == NEVER) ++ if (restriction == NEVER) + { + notsupported("", t1, t2); + } +- else if (restrict == RITCHIE) ++ else if (restriction == RITCHIE) + { + if (RitchieFlag) + notsupported(" (Ritchie Compiler)", t1, t2); + } +- else if (restrict == PREANSI) ++ else if (restriction == PREANSI) + { + if (PreANSIFlag || RitchieFlag) + notsupported(" (Pre-ANSI Compiler)", t1, t2); + } +- else if (restrict == ANSI) ++ else if (restriction == ANSI) + { + if (!RitchieFlag && !PreANSIFlag) + notsupported(" (ANSI Compiler)", t1, t2); +@@ -286,7 +286,7 @@ void mbcheck() + { + (void) fprintf (stderr, + "%s: Internal error in crosscheck[%d,%d]=%d!\n", +- progname, i, j, restrict); ++ progname, i, j, restriction); + exit(1); /* NOTREACHED */ + } + } From 1b8e761de4daf214fc22719aeb287e01c96833cc94daafb0010c537aa8119ef4 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 11 Jun 2015 09:52:25 +0000 Subject: [PATCH 2/2] clean this up :( OBS-URL: https://build.opensuse.org/package/show/devel:tools/cdecl?expand=0&rev=7 --- cdecl.spec | 3 +-- keyword-identifier.patch | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cdecl.spec b/cdecl.spec index 7b60b05..9f687ee 100644 --- a/cdecl.spec +++ b/cdecl.spec @@ -42,8 +42,7 @@ library. %prep %setup -%patch -P 1 -p1 -%patch2 -p1 +%patch -P 1 -P 2 -p1 %build make CFLAGS="%optflags -DUSE_READLINE -DOLD_READLINE" %{?_smp_mflags}; diff --git a/keyword-identifier.patch b/keyword-identifier.patch index ec496a3..ce6b210 100644 --- a/keyword-identifier.patch +++ b/keyword-identifier.patch @@ -1,3 +1,8 @@ +From: schwab@suse.de +Date: Thu Jun 11 09:08:54 +0000 + +"restrict" is a keyword used by the programming language. Rename it. + Index: cdecl-2.5/cdecl.c =================================================================== --- cdecl-2.5.orig/cdecl.c