From nobody@FreeBSD.org  Tue Feb 19 03:46:53 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1948B16A420
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Feb 2008 03:46:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 06FD013C457
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Feb 2008 03:46:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m1J3iOYm077438
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Feb 2008 03:44:24 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m1J3iN5M077437;
	Tue, 19 Feb 2008 03:44:23 GMT
	(envelope-from nobody)
Message-Id: <200802190344.m1J3iN5M077437@www.freebsd.org>
Date: Tue, 19 Feb 2008 03:44:23 GMT
From: Carlos Santos <unixmania@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ensure that x11/xautolock compile with restrictive GCC arguments
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         120830
>Category:       ports
>Synopsis:       ensure that x11/xautolock compile with restrictive GCC arguments
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 19 03:50:01 UTC 2008
>Closed-Date:    Tue Feb 19 08:41:52 UTC 2008
>Last-Modified:  Wed Feb 20 02:20:00 UTC 2008
>Originator:     Carlos Santos
>Release:        7.0-PRERELEASE
>Organization:
n.a.
>Environment:
FreeBSD casantos 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #2: Fri Jan  4 14:52:13 BRST 2008     root@casantos:/share/FreeBSD/src/sys/i386/compile/HP_NX6320  i386

>Description:
I have a host.def file containing

#define GccWarningOptions -Wall -Wpointer-arith -Wstrict-prototypes \
                               -Wmissing-prototypes -Wmissing-declarations \
                               -Wredundant-decls -Wnested-externs
#define DefaultCCOptions -ansi -pedantic -Dasm=__asm__
-Dinline=__inline__ GccWarningOptions

This helps me to catch many erros in X programs built using imake that normally are not caught by GCC. When I attempted to build xautolock it failed because there were comments in C++ style in a C source file (src/engine.c). There were also warnings in include/options.h (extra comma in enum declaration) and in src/message.c (missing prototype of function getAtoms).

The attached file contains the patch files needed to fix the problem. Currently this is not a problem but future versions of GCC may not be so permissive regarding such syntactic mistakes.
>How-To-Repeat:
1. Add the following lines to /usr/local/lib/X11/config/host.def:

#ifndef GccWarningOptions
# define GccWarningOptions      -Wall -Wpointer-arith -Wstrict-prototypes \
                                -Wmissing-prototypes -Wmissing-declarations \
                                -Wredundant-decls -Wnested-externs
#endif
#ifndef DefaultCCOptions
# define DefaultCCOptions       -ansi -pedantic -Dasm=__asm__ -Dinline=__inline__ GccWarningOptions
#endif

2. Attempt to build x11/xautolock

>Fix:
Extract the files contained in the attached tarball and put them in the "files" subdir of the port. Extract using

b64decode -o /dev/stdout x11_xautolock_files.tar.gz.txt | tar -xzf -

Patch attached with submission follows:

begin-base64 644 x11_xautolock_files.tar.gz
H4sICMBDukcCA3gxMV94YXV0b2xvY2sudGFyAO1XbW/bNhD21+hXXFGgiO1IpiTb8gsGZENXDCg2
DHMWYJ8MRaJtIpJokNRcI8h/3x2lqVaSuuuGpFjhg4GTST5H8SGP92glMq4HnWc1xlg0GgF5tIe+
+uPjkPEwjKKAAfODIAo6MOq8gJXaxApfRUlpjo3bbTjPji+ytbj/ia3s/m9jk2zcOH62/R8Ph5/c
/4CN/Wb/g6GP+x+OI9YBdtr/Z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To: open->closed 
State-Changed-By: miwi 
State-Changed-When: Tue Feb 19 08:41:51 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120830 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Subject: Re: ports/120830: commit references a PR
Date: Tue, 19 Feb 2008 08:41:49 +0000 (UTC)
 
 miwi        2008-02-19 08:41:43 UTC
 
   FreeBSD ports repository
 
   Modified files:
     x11/xautolock/files  patch-aa 
   Added files:
     x11/xautolock/files  patch-ab patch-ac 
   Log:
   - Respect restrictive GCC arguments
   
   PR:             120830
   Submitted by:   Carlos Santos <unixmania@gmail.com>
   
   Revision  Changes    Path
   1.5       +21 -3     ports/x11/xautolock/files/patch-aa
   1.1       +11 -0     ports/x11/xautolock/files/patch-ab (new)
   1.1       +11 -0     ports/x11/xautolock/files/patch-ac (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
