Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 196 - Electric Fence (efence-2.2.2.ebuild) will not compile (under gcc 3.0.3)
Summary: Electric Fence (efence-2.2.2.ebuild) will not compile (under gcc 3.0.3)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Geert Bevin
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-16 00:37 UTC by Jared H. Hudson
Modified: 2003-02-04 19:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jared H. Hudson 2002-01-16 00:37:04 UTC
I do not know if this is a gcc 3.0.3 problem only, but when compiling Electric
Fence, it gives the following error:
cc -g -DUSE_SEMAPHORE -fPIC  -c print.c -o print.o
print.c: In function `EF_Printv':
print.c:114: `char' is promoted to `int' when passed through `...'
print.c:114: (so you should pass `int' not `char' to `va_arg')
make: *** [print.o] Error 1

The following patch fixes the problem:
-----------------------------------------------------------------------

diff -u -r ElectricFence-2.2.2.orig/print.c ElectricFence-2.2.2/print.c
--- ElectricFence-2.2.2.orig/print.c	Sun Apr 11 18:29:21 1999
+++ ElectricFence-2.2.2/print.c	Wed Jan 16 00:24:38 2002
@@ -111,7 +111,7 @@
 
			break;
 
		case 'c':
 
			{
-
				char	c = va_arg(args, char);
+
				char	c = va_arg(args, int);
 
				
 
				(void) write(2, &c, 1);
 
			}

------------------------------------------------------------------------
I placed this patch in /usr/portage/dev-util/efence/files/efence-2.2.2.patch
Then edited efence-2.2.2.ebuild to include:
src_compile() {
        patch -p1 < ${FILESDIR}/${P}.patch # This is the included line
	emake || die
}
Comment 1 Geert Bevin 2002-01-28 10:18:43 UTC
This doesn't happen with gcc 2.95.3. Since gcc 3.0.3 is not considered as the
stable gentoo compiler I'd like to leave it like this. Maybe by the time gcc 3
is considered supported, a new version of efence will get out that fixes this.