vl: fix build when configured with no graphic support
PATCH 1/1 vl: fix build when configured with no graphic support
The following error occurs when building no graphic output support:
vl.c: In function ‘main’:
vl.c:2829:19: error: variable ‘ds’ set but not used [-Werror=unused-but-set-variable]
DisplayState *ds;
^cc1: all warnings being treated as errors
To reproduce this issue, just run:
$ ./configure \
--disable-curses \
--disable-sdl \
--disable-cocoa \
--disable-gtk \
--disable-vnc \
--enable-werror
$ make vl.o--- vl.c | 1 + 1 file changed, 1 insertion(+)
vl.c +1 -0
@@ -4269,6 +4269,7 @@ int main(int argc, char **argv, char **envp)/* init local displays */ switch (display_type) {case DT_NOGRAPHIC : + (void )ds;break ;#if defined(CONFIG_CURSES )case DT_CURSES :
Signature · 1 line
1.8.4.rc3
Am 29.10.2013 05:36, schrieb Antony Pavlov:
Quoted 29 lines
The following error occurs when building no graphic output support:
vl.c: In function ‘main’:
vl.c:2829:19: error: variable ‘ds’ set but not used [-Werror=unused-but-set-variable]DisplayState *ds; ^cc1: all warnings being treated as errors
To reproduce this issue, just run:
$ ./configure \ --disable-curses \ --disable-sdl \ --disable-cocoa \ --disable-gtk \ --disable-vnc \ --enable-werror $ make vl.oSigned-off-by Antony Pavlov <[email protected]>--- vl.c | 1 + 1 file changed, 1 insertion(+)vl.c +0
-0
vl.c int main(int argc, char **argv, char **envp) · line 4275
Quoted 7 lines
vl.c +1
-0@@ -4269,6 +4269,7 @@ int main(int argc, char **argv, char **envp)/* init local displays */ switch (display_type) {case DT_NOGRAPHIC : + (void )ds;break ;#if defined(CONFIG_CURSES )case DT_CURSES :
Michael Tokarev
Applied29.10.2013 08:36, Antony Pavlov wrote
Quoted 7 lines
The following error occurs when building no graphic output support:
vl.c: In function ‘main’:
vl.c:2829:19: error: variable ‘ds’ set but not used [-Werror=unused-but-set-variable]DisplayState *ds; ^cc1: all warnings being treated as errors
Thanks, applied to the trivial-patches queue.
While at it, I also added a comment to the line being added, telling what this is all about:
vl.c +1 -0
@@ -4269,6 +4269,7 @@ int main(int argc, char **argv, char **envp)/* init local displays */ switch (display_type) {case DT_NOGRAPHIC : + (void )ds;/* avoid warning if no display is configured */ break ;#if defined(CONFIG_CURSES )case DT_CURSES :
Hopefully it is okay... ;)
/mjt
Quoted 2 lines · On Fri, 01 Nov 2013 14:29:24 +0400 Michael Tokarev <[email protected]> wrote:
29.10.2013 08:36, Antony Pavlov wrote
Quoted 1 line
The following error occurs when building no graphic output support:
^^^^^
Can you plese fix misprint in my git commit message too.
I meant "when building with no graphic output support".
Quoted 26 lines
Quoted 6 lines
vl.c: In function ‘main’:
vl.c:2829:19: error: variable ‘ds’ set but not used [-Werror=unused-but-set-variable]DisplayState *ds; ^cc1: all warnings being treated as errors
Thanks, applied to the trivial-patches queue.
While at it, I also added a comment to the line being added, telling what this is all about:
vl.c +1
-0@@ -4269,6 +4269,7 @@ int main(int argc, char **argv, char **envp)/* init local displays */ switch (display_type) {case DT_NOGRAPHIC : + (void )ds;/* avoid warning if no display is configured */ break ;#if defined(CONFIG_CURSES )case DT_CURSES :Hopefully it is okay... ;)
/mjt
Signature · 3 lines
-- Best regards, Antony Pavlov
Quoted 7 lines · Antony Pavlov
Quoted 2 lines · On Fri, 01 Nov 2013 14:29:24 +0400 Michael Tokarev <[email protected]> wrote:
29.10.2013 08:36, Antony Pavlov wrote
Quoted 1 line
The following error occurs when building no graphic output support:
^^^^^Can you plese fix misprint in my git commit message too.
Fixed. Thank you for pointing this out.
Quoted 1 line
Quoted 1 line
+ (void)ds; /* avoid warning if no display is configured */
Are you okay with me adding the comment? :)
/mjt
Quoted 6 lines · On Fri, 01 Nov 2013 15:18:28 +0400 Michael Tokarev <[email protected]> wrote:
Quoted 5 lines · Antony Pavlov
Quoted 2 lines · On Fri, 01 Nov 2013 14:29:24 +0400 Michael Tokarev <[email protected]> wrote:
29.10.2013 08:36, Antony Pavlov wrote
Quoted 1 line
The following error occurs when building no graphic output support:
Quoted 8 lines
Quoted 2 lines
^^^^^Can you plese fix misprint in my git commit message too.
Fixed. Thank you for pointing this out.
Quoted 1 line
Quoted 1 line
+ (void)ds; /* avoid warning if no display is configured */
Are you okay with me adding the comment? :)
IMHO your comment is useful, thanks!
--
Best regards,
Antony Pavlov