Skip to contentSkip to conversation

lib.c: skip --param parameters

PATCH In review Andy Shevchenko 3 participants 5 messages Jun 16, 2014 – Jun 17, 2014 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib.c: skip --param parameters

Very dumb patch to just skip --param allow-store-data-races=0 introduced in newest Linux kernel buildsystem.

Actually the option is present in few GCC versions and probably should be handled properly.

---
 lib.c | 7 +++++++
 1 file changed, 7 insertions(+)
lib.c +7 -0
index bf3e91c..e56037b 100644
@@ -673,6 +673,12 @@ static char **handle_version(char *arg, char **next)
 	exit(0);
 }
 
+static char **handle_param(char *arg, char **next)
+{
+	++next;
+	return ++next;
+}
+
 struct switches {
 	const char *name;
 	char **(*fn)(char *, char **);
@@ -681,6 +687,7 @@ struct switches {
 static char **handle_long_options(char *arg, char **next)
 {
 	static struct switches cmd[] = {
+		{ "param", handle_param },
 		{ "version", handle_version },
 		{ NULL, NULL }
 	};
Signature · 1 line
2.0.0
#1 lore raw
Quoted 7 lines · Andy Shevchenko

Very dumb patch to just skip --param allow-store-data-races=0 introduced in newest Linux kernel buildsystem.

Actually the option is present in few GCC versions and probably should be handled properly.

As far as I can tell, this seems to only handle "--param arg"; however, according to the thread on LKML, GCC handles --param=arg as well. Could you please handle that variant too?

Quoted 35 lines
 lib.c | 7 +++++++
 1 file changed, 7 insertions(+)
lib.c +7 -0
index bf3e91c..e56037b 100644
@@ -673,6 +673,12 @@ static char **handle_version(char *arg, char **next)
 	exit(0);
 }
 
+static char **handle_param(char *arg, char **next)
+{
+	++next;
+	return ++next;
+}
+
 struct switches {
 	const char *name;
 	char **(*fn)(char *, char **);
@@ -681,6 +687,7 @@ struct switches {
 static char **handle_long_options(char *arg, char **next)
 {
 	static struct switches cmd[] = {
+		{ "param", handle_param },
 		{ "version", handle_version },
 		{ NULL, NULL }
 	};
Signature · 6 lines
2.0.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 4 lines · Josh Triplett
Quoted 3 lines · Andy Shevchenko

Very dumb patch to just skip --param allow-store-data-races=0 introduced in newest Linux kernel buildsystem.

Quoted 9 lines
Quoted 4 lines

Actually the option is present in few GCC versions and probably should be handled properly.

As far as I can tell, this seems to only handle "--param arg"; however, according to the thread on LKML, GCC handles --param=arg as well. Could you please handle that variant too?

This is only from linux-next and not Linus's tree, correct?

Is this still necessary since the "./Makefile: tell gcc optimizer to never introduce new data races" patch has been removed from -mm due to failures?

See http://marc.info/?l=linux-mm-commits&m=140295825623471

Quoted 28 lines
Quoted 28 lines
 lib.c | 7 +++++++
 1 file changed, 7 insertions(+)
lib.c +7 -0
index bf3e91c..e56037b 100644
@@ -673,6 +673,12 @@ static char **handle_version(char *arg, char **next)
 	exit(0);
 }
 
+static char **handle_param(char *arg, char **next)
+{
+	++next;
+	return ++next;
+}
+
 struct switches {
 	const char *name;
 	char **(*fn)(char *, char **);
@@ -681,6 +687,7 @@ struct switches {
 static char **handle_long_options(char *arg, char **next)
 {
 	static struct switches cmd[] = {
+		{ "param", handle_param },
 		{ "version", handle_version },
 		{ NULL, NULL }
 	};
#3 lore raw
Quoted 16 lines · David Rientjes
Quoted 4 lines · Josh Triplett
Quoted 3 lines · Andy Shevchenko

Very dumb patch to just skip --param allow-store-data-races=0 introduced in newest Linux kernel buildsystem.

Quoted 9 lines
Quoted 4 lines

Actually the option is present in few GCC versions and probably should be handled properly.

As far as I can tell, this seems to only handle "--param arg"; however, according to the thread on LKML, GCC handles --param=arg as well. Could you please handle that variant too?

Quoted 6 lines

This is only from linux-next and not Linus's tree, correct?

Is this still necessary since the "./Makefile: tell gcc optimizer to never introduce new data races" patch has been removed from -mm due to failures?

See http://marc.info/?l=linux-mm-commits&m=140295825623471

I'd still like to see Sparse not choke on the option, in either form, whether the kernel ends up using it or not.

- Josh Triplett

#4 lore raw
In reply to Josh Triplett
Quoted 4 lines · Josh Triplett
Quoted 3 lines · Andy Shevchenko

Very dumb patch to just skip --param allow-store-data-races=0 introduced in newest Linux kernel buildsystem.

Quoted 8 lines
Quoted 4 lines

Actually the option is present in few GCC versions and probably should be handled properly.

As far as I can tell, this seems to only handle "--param arg"; however, according to the thread on LKML, GCC handles --param=arg as well. Could you please handle that variant too?

Yes, I will in v2.

Quoted 36 lines
Quoted 36 lines
 lib.c | 7 +++++++
 1 file changed, 7 insertions(+)
lib.c +7 -0
index bf3e91c..e56037b 100644
@@ -673,6 +673,12 @@ static char **handle_version(char *arg, char **next)
 	exit(0);
 }
 
+static char **handle_param(char *arg, char **next)
+{
+	++next;
+	return ++next;
+}
+
 struct switches {
 	const char *name;
 	char **(*fn)(char *, char **);
@@ -681,6 +687,7 @@ struct switches {
 static char **handle_long_options(char *arg, char **next)
 {
 	static struct switches cmd[] = {
+		{ "param", handle_param },
 		{ "version", handle_version },
 		{ NULL, NULL }
 	};
Signature · 6 lines
2.0.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy