After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 797204 - vaapi: tests: compile error since 00f5fe9ccf
vaapi: tests: compile error since 00f5fe9ccf
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
git master
Other Linux
: Normal critical
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-09-25 22:26 UTC by U. Artie Eoff
Modified: 2018-09-26 17:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix compilation errors (790 bytes, patch)
2018-09-25 22:40 UTC, U. Artie Eoff
reviewed Details | Review
tests: fix compilation (997 bytes, patch)
2018-09-26 16:28 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description U. Artie Eoff 2018-09-25 22:26:40 UTC
Compilation fails on Ubuntu Xenial (gcc 5.4.0) and Fedora 27 (gcc 7.3.1) since...

commit 00f5fe9ccfc7183eb0f3f02f6efcca06343e70b2
Author: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Date:   Tue Sep 25 20:28:02 2018 +0200

    tests: don's use sysdeps.h in header


Compilation succeeds on Ubuntu Bionic (gcc 7.3.0) and Fedora 28 (gcc 8.1.1)
Comment 1 U. Artie Eoff 2018-09-25 22:29:22 UTC
y4mreader.c: In function 'parse_int':
y4mreader.c:44:11: error: implicit declaration of function 'strtol'; did you mean 'g_strtod'? [-Werror=implicit-function-declaration]
   value = strtol (str, NULL, 0);
           ^~~~~~
           g_strtod
y4mreader.c:44:11: error: nested extern declaration of 'strtol' [-Werror=nested-externs]
y4mreader.c: In function 'parse_header':
y4mreader.c:63:3: error: implicit declaration of function 'memset' [-Werror=implicit-function-declaration]
   memset (header, 0, BUFSIZ);
   ^~~~~~
y4mreader.c:63:3: error: incompatible implicit declaration of built-in function 'memset' [-Werror]
y4mreader.c:63:3: note: include '<string.h>' or provide a declaration of 'memset'
y4mreader.c:68:7: error: implicit declaration of function 'memcmp' [-Werror=implicit-function-declaration]
   if (memcmp (header, "YUV4MPEG2", 9) != 0)
       ^~~~~~
y4mreader.c:97:15: error: implicit declaration of function 'strncmp' [-Werror=implicit-function-declaration]
           if (strncmp (str, "420", 3) != 0) {
               ^~~~~~~
y4mreader.c: In function 'skip_frame_header':
y4mreader.c:191:3: error: incompatible implicit declaration of built-in function 'memset' [-Werror]
   memset (header, 0, BUFSIZ);
   ^~~~~~
y4mreader.c:191:3: note: include '<string.h>' or provide a declaration of 'memset'
cc1: all warnings being treated as errors
make[3]: *** [Makefile:977: simple_encoder-y4mreader.o] Error 1
make[3]: Leaving directory '/opt/media/build/gstreamer-vaapi/tests'
make[2]: *** [Makefile:1157: all-recursive] Error 1
make[2]: Leaving directory '/opt/media/build/gstreamer-vaapi/tests'
make[1]: *** [Makefile:541: all-recursive] Error 1
make[1]: Leaving directory '/opt/media/build/gstreamer-vaapi'
make: *** [Makefile:473: all] Error 2
Comment 2 U. Artie Eoff 2018-09-25 22:40:22 UTC
Created attachment 373761 [details] [review]
fix compilation errors
Comment 3 Víctor Manuel Jáquez Leal 2018-09-26 06:24:07 UTC
Review of attachment 373761 [details] [review]:

::: tests/y4mreader.c
@@ +20,3 @@
  */
 
+#include "gst/vaapi/sysdeps.h"

Why not just include string.h?
Comment 4 Víctor Manuel Jáquez Leal 2018-09-26 15:59:57 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #3)
> Review of attachment 373761 [details] [review] [review]:
> 
> ::: tests/y4mreader.c
> @@ +20,3 @@
>   */
>  
> +#include "gst/vaapi/sysdeps.h"
> 
> Why not just include string.h?

It seems not. It requires <gst/gst.h>

The header handling inside gstreamer-vaapi is a mess :(

Cooking a patch
Comment 5 U. Artie Eoff 2018-09-26 16:11:16 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #3)
> Review of attachment 373761 [details] [review] [review]:
> 
> ::: tests/y4mreader.c
> @@ +20,3 @@
>   */
>  
> +#include "gst/vaapi/sysdeps.h"
> 
> Why not just include string.h?

Because sysdeps.h includes two headers needed here.  It also includes the project config.h first, which is traditionally intended to be used in all compilation units to prevent inconsistencies in declarations, etc...
Comment 6 Víctor Manuel Jáquez Leal 2018-09-26 16:28:03 UTC
Created attachment 373773 [details] [review]
tests: fix compilation
Comment 7 Víctor Manuel Jáquez Leal 2018-09-26 16:32:29 UTC
Comment on attachment 373773 [details] [review]
tests: fix compilation

pushed attachment 373773 [details] [review] as commit fbc5ed16 - tests: fix compilation
Comment 8 Víctor Manuel Jáquez Leal 2018-09-26 16:33:12 UTC
Artie, reopen if the problem isn't fixed :)
Comment 9 U. Artie Eoff 2018-09-26 16:46:53 UTC
Victor,
Why wouldn't we want config.h included in all compilation units (.c files).   If it's not included first, then all subsequent includes (including indirect includes) could potentially introduce inconsistent declarations.  I mean, that's the purpose of using a config.h in the first place, isn't it.
Comment 10 U. Artie Eoff 2018-09-26 16:50:16 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #8)
> Artie, reopen if the problem isn't fixed :)

y4mreader.c:43:11: error: implicit declaration of function 'strtol'; did you mean 'strtok'? [-Werror=implicit-function-declaration]
   value = strtol (str, NULL, 0);
           ^~~~~~
           strtok
Comment 11 U. Artie Eoff 2018-09-26 16:52:30 UTC
strtol is in stdlib.h
Comment 12 Víctor Manuel Jáquez Leal 2018-09-26 17:39:49 UTC
a modified version of attachment 373761 [details] [review] was pushed