kbuild: check return value of asprintf()
PATCH 1/1 kbuild: check return value of asprintf()
Check return value of asprintf() in docsect() and exit if error occurs. This removes following warning:
HOSTCC scripts/basic/docprocscripts/basic/docproc.c: In function ‘docsect’:scripts/basic/docproc.c:336: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result
---
The patch is on top of v2.6.36, thanks.
scripts/basic/docproc.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
scripts/basic/docproc.c +4 -1
@@ -333,7 +333,10 @@ static void docsect(char *filename, char *line)if (*s =='\n' ) *s ='\0' ; -asprintf (&s,"DOC: %s" , line); +if (asprintf (&s,"DOC: %s" , line) <0 ) { +perror ("asprintf" ); +exit (1 ); + }consume_symbol (s);free (s);
Signature · 1 line
1.7.0.4
(adding Randy to CC)
Quoted 31 lines · Namhyung Kim
Check return value of
asprintf()indocsect()and exit if error occurs. This removes following warning:HOSTCC
scripts/basic/docprocscripts/basic/docproc.c: In function ‘docsect’:scripts/basic/docproc.c:336: warning: ignoring return value of ‘asprintf’,
declared with attributewarn_unused_resultSigned-off-by Namhyung Kim <[email protected]>---
The patch is on top of v2.6.36, thanks.scripts/basic/docproc.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)scripts/basic/docproc.c +4
-1@@ -333,7 +333,10 @@ static void docsect(char *filename, char *line)if (*s =='\n' ) *s ='\0' ; -asprintf (&s,"DOC: %s" , line); +if (asprintf (&s,"DOC: %s" , line) <0 ) { +perror ("asprintf" ); +exit (1 ); + }consume_symbol (s);free (s);
Randy Dunlap
Acked-byQuoted 1 line · Michal Marek
(adding Randy to CC)
Thanks, Michal.
Quoted 33 lines · Namhyung Kim
Quoted 31 lines
Check return value of
asprintf()indocsect()and exit if error occurs. This removes following warning:HOSTCC
scripts/basic/docprocscripts/basic/docproc.c: In function ‘docsect’:scripts/basic/docproc.c:336: warning: ignoring return value of ‘asprintf’,
declared with attributewarn_unused_resultSigned-off-by Namhyung Kim <[email protected]>---
The patch is on top of v2.6.36, thanks.scripts/basic/docproc.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)scripts/basic/docproc.c +4
-1@@ -333,7 +333,10 @@ static void docsect(char *filename, char *line)if (*s =='\n' ) *s ='\0' ; -asprintf (&s,"DOC: %s" , line); +if (asprintf (&s,"DOC: %s" , line) <0 ) { +perror ("asprintf" ); +exit (1 ); + }consume_symbol (s);free (s);
Signature · 2 lines
~Randy *** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 6 lines · Randy Dunlap
Quoted 1 line · Michal Marek
(adding Randy to CC)
Thanks, Michal.
Acked-by Randy Dunlap <[email protected]>
OK, applied to kbuild-2.6.git#misc.
Michal
Quoted 37 lines
Quoted 35 lines · Namhyung Kim
Quoted 31 lines
Check return value of
asprintf()indocsect()and exit if error occurs. This removes following warning:HOSTCC
scripts/basic/docprocscripts/basic/docproc.c: In function ‘docsect’:scripts/basic/docproc.c:336: warning: ignoring return value of ‘asprintf’,
declared with attributewarn_unused_resultSigned-off-by Namhyung Kim <[email protected]>---
The patch is on top of v2.6.36, thanks.scripts/basic/docproc.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)scripts/basic/docproc.c +4
-1@@ -333,7 +333,10 @@ static void docsect(char *filename, char *line)if (*s =='\n' ) *s ='\0' ; -asprintf (&s,"DOC: %s" , line); +if (asprintf (&s,"DOC: %s" , line) <0 ) { +perror ("asprintf" ); +exit (1 ); + }consume_symbol (s);free (s);