[Parted-maintainers] Bug#259534: marked as done (parted: FTBFS with gcc-3.4: passing arg 5 of `ped_assert' discards qualifier from pointer target type)

Debian Bug Tracking System owner@bugs.debian.org
Thu, 25 Nov 2004 05:33:27 -0800


Your message dated Thu, 25 Nov 2004 14:32:53 +0100
with message-id <20041125133253.GA18450@pegasos>
and subject line all fixed in NMUs, aknowledging them ...
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 15 Jul 2004 10:41:45 +0000
>From aj@andaco.de Thu Jul 15 03:41:45 2004
Return-path: <aj@andaco.de>
Received: from c204015.adsl.hansenet.de (localhost) [213.39.204.15] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1Bl3gO-0006Zh-00; Thu, 15 Jul 2004 03:41:44 -0700
Received: from aj by localhost with local (Exim 4.34)
	id 1Bl3gI-0002vi-Vf; Thu, 15 Jul 2004 12:41:39 +0200
To: Debian Bug Tracking System <submit@bugs.debian.org>
From: Andreas Jochens <aj@andaco.de>
Subject: parted: FTBFS with gcc-3.4: passing arg 5 of `ped_assert' discards qualifier from pointer target type
Message-Id: <E1Bl3gI-0002vi-Vf@localhost>
Date: Thu, 15 Jul 2004 12:41:39 +0200
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 

Package: parted
Severity: normal
Tags: patch

When building 'parted' with gcc-3.4 I get the following error:

 x86_64-linux-gcc -DHAVE_CONFIG_H -I. -I../../../libparted/fs_ext2 -I../.. -I../../../include -g -O2 -D_REENTRANT -D_FILE_OFFSET_BITS=no -DLOCALEDIR=\"/usr/share/locale\" -DLOCALEDIR=\"/usr/share/locale\" -W -Wall -Wno-unused -Wno-switch -Wno-format -Werror -MT ext2.lo -MD -MP -MF .deps/ext2.Tpo -c ../../../libparted/fs_ext2/ext2.c  -fPIC -DPIC -o .libs/ext2.o
In file included from ../../../libparted/fs_ext2/ext2.c:29:
../../../libparted/fs_ext2/ext2.h: In function `ext2_is_data_block':
../../../libparted/fs_ext2/ext2.h:219: warning: passing arg 5 of `ped_assert' discards qualifiers from pointer target type
../../../libparted/fs_ext2/ext2.h:220: warning: passing arg 5 of `ped_assert' discards qualifiers from pointer target type
make[4]: *** [ext2.lo] Error 1
make[4]: Leaving directory `/parted-1.6.9/build/libparted/fs_ext2'

When this is fixed by adding a 'const' to the definition of 'ped_assert',
I get the following error:

 x86_64-linux-gcc -DHAVE_CONFIG_H -I. -I../../libparted -I.. -I../../include -g -O2 -D_REENTRANT -D_FILE_OFFSET_BITS=no -DLOCALEDIR=\"/usr/share/locale\" -DLOCALEDIR=\"/usr/share/locale\" -W -Wall -Wno-unused -Wno-switch -Wno-format -Werror -MT exception.lo -MD -MP -MF .deps/exception.Tpo -c ../../libparted/exception.c  -fPIC -DPIC -o .libs/exception.o
../../libparted/exception.c:72: warning: conflicting types for built-in function 'log2'
make[4]: *** [exception.lo] Error 1

With the attached patch 'parted' can be compiled using gcc-3.4.

Regards
Andreas Jochens

diff -urN ../tmp-orig/parted-1.6.9/include/parted/debug.h ./include/parted/debug.h
--- ../tmp-orig/parted-1.6.9/include/parted/debug.h	2002-12-10 00:06:55.000000000 +0100
+++ ./include/parted/debug.h	2004-07-15 12:21:41.851966211 +0200
@@ -25,7 +25,7 @@
 #ifdef DEBUG
 
 extern int
-ped_assert (int cond, char* cond_text, char* file, int line, char* function);
+ped_assert (int cond, char* cond_text, char* file, int line, const char* function);
 
 #ifdef __GNUC__
 
diff -urN ../tmp-orig/parted-1.6.9/libparted/exception.c ./libparted/exception.c
--- ../tmp-orig/parted-1.6.9/libparted/exception.c	2002-04-08 12:08:27.000000000 +0200
+++ ./libparted/exception.c	2004-07-15 12:23:59.072562927 +0200
@@ -68,7 +68,7 @@
 }
 
 static int
-log2 (int n)
+log_2 (int n)
 {
 	int	x;
 	for (x=0; 1 << x <= n; x++);
@@ -78,7 +78,7 @@
 char*
 ped_exception_get_option_string (PedExceptionOption ex_opt)
 {
-	return option_strings [log2 (ex_opt)];
+	return option_strings [log_2 (ex_opt)];
 }
 
 static PedExceptionOption

---------------------------------------
Received: (at 259534-done) by bugs.debian.org; 25 Nov 2004 13:29:27 +0000
>From sven.luther@wanadoo.fr Thu Nov 25 05:29:27 2004
Return-path: <sven.luther@wanadoo.fr>
Received: from smtp8.wanadoo.fr (mwinf0809.wanadoo.fr) [193.252.22.23] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1CXJgd-0004Sq-00; Thu, 25 Nov 2004 05:29:27 -0800
Received: from me-wanadoo.net (localhost [127.0.0.1])
	by mwinf0809.wanadoo.fr (SMTP Server) with SMTP
	id E94F118000F7; Thu, 25 Nov 2004 14:28:55 +0100 (CET)
Received: from pegasos (AStrasbourg-251-1-24-132.w82-126.abo.wanadoo.fr [82.126.214.132])
	by mwinf0809.wanadoo.fr (SMTP Server) with ESMTP
	id C8BA1180005E; Thu, 25 Nov 2004 14:28:55 +0100 (CET)
Received: from luther by pegasos with local (Exim 4.34)
	id 1CXJjy-0004nk-32; Thu, 25 Nov 2004 14:32:54 +0100
Date: Thu, 25 Nov 2004 14:32:53 +0100
To: 239371-done@bugs.debian.org, 239372-done@bugs.debian.org,
	259248-done@bugs.debian.org, 247174-done@bugs.debian.org,
	259534-done@bugs.debian.org, 258188-done@bugs.debian.org
Subject: all fixed in NMUs, aknowledging them ...
Message-ID: <20041125133253.GA18450@pegasos>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
User-Agent: Mutt/1.5.6+20040907i
From: Sven Luther <sven.luther@wanadoo.fr>
Delivered-To: 259534-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 
X-CrossAssassin-Score: 6

As subject said. 

Friendly,

Sven Luther