Bug#643464: radeontool: FTBFS: radeontool.c:42:5: error: format not a string literal and no format arguments [-Werror=format-security]

2011-10-03 Thread Tormod Volden
On Wed, Sep 28, 2011 at 1:52 PM, Jonathan Nieder wrote:
 Didier Raboud wrote:

 radeontool.c: In function 'fatal':
 radeontool.c:42:5: error: format not a string literal and no format 
 arguments [-Werror=format-security]

 Yep, known.  The patch below (excluding the hunk patching radeonreg
 since radeonreg is not in sid yet) should fix it.  I'd like to send a
 batch of patches upstream soon addressing warnings including this one,
 but maybe it's worth an upload to fix the build before then.

Hi, I sent a bunch of patches to Dave Airlied many weeks ago, which
also fixed this. I will have to ping him again. I should also push it
to a branch of my own so that you can see what I have done already.

Cheers,
Tormod



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#643464: radeontool: FTBFS: radeontool.c:42:5: error: format not a string literal and no format arguments [-Werror=format-security]

2011-10-03 Thread Tormod Volden
On Mon, Oct 3, 2011 at 4:13 PM, Tormod Volden wrote:
 also fixed this. I will have to ping him again. I should also push it
 to a branch of my own so that you can see what I have done already.

http://cgit.freedesktop.org/~tormod/radeontool/



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#643464: radeontool: FTBFS: radeontool.c:42:5: error: format not a string literal and no format arguments [-Werror=format-security]

2011-09-28 Thread Jonathan Nieder
tags 643464 + upstream
quit

Hi,

Didier Raboud wrote:

 radeontool.c: In function 'fatal':
 radeontool.c:42:5: error: format not a string literal and no format 
 arguments [-Werror=format-security]

Yep, known.  The patch below (excluding the hunk patching radeonreg
since radeonreg is not in sid yet) should fix it.  I'd like to send a
batch of patches upstream soon addressing warnings including this one,
but maybe it's worth an upload to fix the build before then.

-- 8 --
Subject: avoid -Wformat-security warnings

fatal() is never called with a user-specified argument so it is safe
to pass its argument as an fprintf format string, but gcc doesn't know
that.  Using fprintf(stderr, %s, arg) makes the intent clearer.

Signed-off-by: Jonathan Nieder jrnie...@gmail.com
---
Thanks,
Jonathan

 avivotool.c  |2 +-
 radeonreg.c  |2 +-
 radeontool.c |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/avivotool.c b/avivotool.c
index 240f523f..02b03bab 100644
--- a/avivotool.c
+++ b/avivotool.c
@@ -64,7 +64,7 @@ unsigned char * volatile fb_mem;
 
 static void fatal(char *why)
 {
-fprintf(stderr, why);
+fprintf(stderr, %s, why);
 pci_system_cleanup();
 
 }
diff --git a/radeonreg.c b/radeonreg.c
index 9948665c..5f1ab61d 100644
--- a/radeonreg.c
+++ b/radeonreg.c
@@ -47,7 +47,7 @@ unsigned char * volatile fb_mem;
 
 static void fatal(char *why)
 {
-fprintf(stderr, why);
+fprintf(stderr, %s, why);
 pci_system_cleanup();
 
 }
diff --git a/radeontool.c b/radeontool.c
index 6e269f1a..97b2c406 100644
--- a/radeontool.c
+++ b/radeontool.c
@@ -39,7 +39,7 @@ unsigned char * volatile ctrl_mem;
 static void radeon_rom_legacy_mmio_table(unsigned char *bios, int offset);
 static void fatal(char *why)
 {
-fprintf(stderr,why);
+fprintf(stderr, %s, why);
 pci_system_cleanup();
 exit(-1);
 }
-- 
1.7.7.rc1




-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#643464: radeontool: FTBFS: radeontool.c:42:5: error: format not a string literal and no format arguments [-Werror=format-security]

2011-09-27 Thread Didier Raboud
Source: radeontool
Version: 1.6.2-1
Severity: serious
Tags: wheezy sid
User: debian...@lists.debian.org
Usertags: qa-ftbfs-20110923 qa-ftbfs hardening-format-security hardening
Justification: FTBFS on amd64

Hi,

During a rebuild of all packages in sid, your package failed to build on
amd64.

Relevant part:
 gcc -DPACKAGE_NAME=\radeontool\ -DPACKAGE_TARNAME=\radeontool\ 
 -DPACKAGE_VERSION=\1.6.2\ -DPACKAGE_STRING=\radeontool\ 1.6.2\ 
 -DPACKAGE_BUGREPORT=\xorg-driver-...@lists.x.org\ -DPACKAGE_URL=\\ 
 -DPACKAGE=\radeontool\ -DVERSION=\1.6.2\ -DSTDC_HEADERS=1 
 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 
 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 
 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\.libs/\ -I. -Wall -g 
 -O2 -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat 
 -Wformat-security -Werror=format-security -c radeontool.c
 radeontool.c: In function 'fatal':
 radeontool.c:42:5: error: format not a string literal and no format arguments 
 [-Werror=format-security]
 radeontool.c: In function 'map_radeon_cntl_mem':
 radeontool.c:969:5: warning: 'pci_device_map_region' is deprecated (declared 
 at /usr/include/pciaccess.h:85) [-Wdeprecated-declarations]
 radeontool.c:973:5: warning: 'pci_device_map_region' is deprecated (declared 
 at /usr/include/pciaccess.h:85) [-Wdeprecated-declarations]
 radeontool.c: In function 'radeon_rom_legacy_mmio_table':
 radeontool.c:2175:36: warning: unused variable 'tmp' [-Wunused-variable]
 radeontool.c: In function 'radeon_rom_legacy_dynclk1table':
 radeontool.c:2284:27: warning: unused variable 'i' [-Wunused-variable]
 radeontool.c:2284:20: warning: unused variable 'start' [-Wunused-variable]
 radeontool.c:2284:14: warning: unused variable 'type' [-Wunused-variable]
 radeontool.c: In function 'radeon_rom_legacy_pllinittable':
 radeontool.c:2297:27: warning: unused variable 'i' [-Wunused-variable]
 radeontool.c:2297:20: warning: unused variable 'start' [-Wunused-variable]
 radeontool.c:2297:14: warning: unused variable 'type' [-Wunused-variable]
 radeontool.c: In function 'radeon_rom_legacy_igptable':
 radeontool.c:2368:2: warning: format '%f' expects argument of type 'double', 
 but argument 2 has type 'int' [-Wformat]
 radeontool.c:2378:6: warning: format '%f' expects argument of type 'double', 
 but argument 2 has type 'int' [-Wformat]
 radeontool.c:2379:6: warning: format '%f' expects argument of type 'double', 
 but argument 2 has type 'int' [-Wformat]
 radeontool.c:2380:6: warning: format '%f' expects argument of type 'double', 
 but argument 2 has type 'int' [-Wformat]
 radeontool.c: At top level:
 radeontool.c:136:13: warning: 'radeon_set_mcind' defined but not used 
 [-Wunused-function]
 radeontool.c: In function 'radeon_rom_tables':
 radeontool.c:2803:6: warning: ignoring return value of 'read', declared with 
 attribute warn_unused_result [-Wunused-result]
 cc1: some warnings being treated as errors
 
 make[2]: *** [radeontool.o] Error 1

The full build log is available from:
   
http://people.debian.org/~lucas/logs/2011/09/23/radeontool_1.6.2-1_lsid64.buildlog

This happened because since dpkg 1.16.0 [0], hardening flags are enabled 
under various conditions.

[0] http://lists.debian.org/debian-devel-announce/2011/09/msg1.html

A list of current common problems and possible solutions is available at 
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

About the archive rebuild: The rebuild was done on about 50 AMD64 nodes
of the Grid'5000 platform, using a clean chroot.  Internet was not
accessible from the build systems.



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org