Skip to contentSkip to conversation

overlay: Fix compiler warning when compiling with meson

PATCH In review Maarten Lankhorst 4 participants 5 messages Nov 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 overlay: Fix compiler warning when compiling with meson

[1/316] Compiling C object 'overlay/intel-gpu-overlay@exe/overlay.c.o'.
../overlay/overlay.c: In function ‘show_gem_objects’:
../overlay/overlay.c:798:31: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 160 [-Wformat-truncation=]
snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects",

                               ^~
../overlay/overlay.c:798:30: note: using the range [-9223372036854775808, 9223372036854775807] for directive argument
   snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects",
                              ^~~~~~~~~~~~~~~~~~~~~~~

../overlay/overlay.c:798:30: note: using the range [-9223372036854775808, 9223372036854775807] for directive argument ../overlay/overlay.c:798:3: note: ‘snprintf’ output between 16 and 309 bytes into a destination of size 160
snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    comm->name, comm->bytes >> 20, comm->count);

Might as well give it the 309 bytes it wants, plus on more. :-)

---
 overlay/overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
overlay/overlay.c +1 -1
index b30f7a1d66da..4804f813554a 100644
@@ -740,7 +740,7 @@ static void init_gem_objects(struct overlay_context *ctx,
 static void show_gem_objects(struct overlay_context *ctx, struct overlay_gem_objects *go)
 {
 	struct gem_objects_comm *comm;
-	char buf[160];
+	char buf[310];
 	cairo_pattern_t *linear;
 	int x, y, y1, y2;
 
Signature · 6 lines
2.15.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw

Quoting Maarten Lankhorst (2017-11-21 13:26:50)

meson isn't required, just a recent gcc.

Quoted 12 lines

[1/316] Compiling C object 'overlay/intel-gpu-overlay@exe/overlay.c.o'.
../overlay/overlay.c: In function ‘show_gem_objects’:
../overlay/overlay.c:798:31: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 160 [-Wformat-truncation=]
snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects",

                               ^~
../overlay/overlay.c:798:30: note: using the range [-9223372036854775808, 9223372036854775807] for directive argument
   snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects",
                              ^~~~~~~~~~~~~~~~~~~~~~~

../overlay/overlay.c:798:30: note: using the range [-9223372036854775808, 9223372036854775807] for directive argument ../overlay/overlay.c:798:3: note: ‘snprintf’ output between 16 and 309 bytes into a destination of size 160
snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Quoted 5 lines
    comm->name, comm->bytes >> 20, comm->count);

Might as well give it the 309 bytes it wants, plus on more. :-)

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✓ Fi.CI.BAT: success for overlay: Fix compiler warning when compiling with meson

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: overlay: Fix compiler warning when compiling with meson
URL : https://patchwork.freedesktop.org/series/34160/
State : success

== Summary ==

IGT patchset tested on top of latest successful build 538091ce7008b4281d912422d8bb676c541401a4 tools: Stop opening the driver just to find the debugfs

with latest DRM-Tip kernel build CI_DRM_3368
f71044153bec drm-tip: 2017y-11m-21d-10h-48m-53s UTC integration manifest

No testlist changes.

Test chamelium:

        Subgroup dp-crc-fast:
                fail       -> PASS       (fi-kbl-7500u) fdo#103163
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

fdo#103163 https://bugs.freedesktop.org/show_bug.cgi?id=103163
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:443s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:463s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:382s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:548s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:279s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:511s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:506s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:507s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:507s
fi-cfl-s2        total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:615s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:432s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:267s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:543s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:430s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:440s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:436s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:484s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:462s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:487s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:535s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:478s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:536s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:578s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:546s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:569s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:531s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:501s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:463s
fi-snb-2520m     total:246  pass:212  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:430s
Blacklisted hosts:
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:570s
fi-glk-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:494s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_515/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

✗ Fi.CI.IGT: warning for overlay: Fix compiler warning when compiling with meson

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: overlay: Fix compiler warning when compiling with meson
URL : https://patchwork.freedesktop.org/series/34160/
State : warning

== Summary ==

Test drv_selftest:

        Subgroup mock_sanitycheck:
                dmesg-warn -> PASS       (shard-hsw) fdo#103719
Test gem_exec_reloc:
        Subgroup basic-write-cpu-noreloc:
                incomplete -> PASS       (shard-snb)
Test drv_module_reload:
        Subgroup basic-reload-inject:
                pass       -> DMESG-WARN (shard-snb) fdo#102707
Test perf:
        Subgroup blocking:
                pass       -> FAIL       (shard-hsw) fdo#102252
Test kms_plane:
        Subgroup plane-position-hole-dpms-pipe-b-planes:
                pass       -> SKIP       (shard-hsw)
        Subgroup plane-panning-bottom-right-suspend-pipe-b-planes:
                pass       -> SKIP       (shard-hsw)
Test kms_flip:
        Subgroup wf_vblank-vs-modeset-interruptible:
                pass       -> SKIP       (shard-hsw) fdo#102614
Test kms_vblank:
        Subgroup wait-busy:
                pass       -> SKIP       (shard-hsw)
Test kms_cursor_crc:
        Subgroup cursor-128x128-random:
                pass       -> SKIP       (shard-hsw)
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912

fdo#103719 https://bugs.freedesktop.org/show_bug.cgi?id=103719
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

shard-hsw        total:2585 pass:1468 dwarn:1   dfail:1   fail:11  skip:1104 time:9231s
shard-snb        total:2585 pass:1258 dwarn:2   dfail:1   fail:11  skip:1313 time:7972s

Blacklisted hosts:
shard-apl total:2585 pass:1625 dwarn:2 dfail:1 fail:21 skip:936 time:13057s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_515/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
In reply to Maarten Lankhorst
Quoted 10 lines · Maarten Lankhorst

[1/316] Compiling C object 'overlay/intel-gpu-overlay@exe/overlay.c.o'.
../overlay/overlay.c: In function ‘show_gem_objects’:
../overlay/overlay.c:798:31: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 160 [-Wformat-truncation=]
snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects",
^~
../overlay/overlay.c:798:30: note: using the range [-9223372036854775808, 9223372036854775807] for directive argument
snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects",
^~~~~~~~~~~~~~~~~~~~~~~
../overlay/overlay.c:798:30: note: using the range [-9223372036854775808, 9223372036854775807] for directive argument ../overlay/overlay.c:798:3: note: ‘snprintf’ output between 16 and 309 bytes into a destination of size 160

Quoted 5 lines
    snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comm->name, comm->bytes >> 20, comm->count);

Might as well give it the 309 bytes it wants, plus on more. :-)

My bad for not pushing my fix for the same from a few weeks back. a) I was hoping the whole series could go in one, and b) patchwork did not spot the r-b reply I got.

Regards,

Tvrtko

Quoted 11 lines
---
  overlay/overlay.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
overlay/overlay.c +0 -0
index b30f7a1d66da..4804f813554a 100644

overlay/overlay.c static void init_gem_objects(struct overlay_context *ctx, · line 746

Quoted 8 lines
overlay/overlay.c +1 -1
@@ -740,7 +740,7 @@ static void init_gem_objects(struct overlay_context *ctx,
  static void show_gem_objects(struct overlay_context *ctx, struct overlay_gem_objects *go)
  {
  	struct gem_objects_comm *comm;
-	char buf[160];
+	char buf[310];
  	cairo_pattern_t *linear;
  	int x, y, y1, y2;
 

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx