Bug 120830

Summary: ensure that x11/xautolock compile with restrictive GCC arguments
Product: Ports & Packages Reporter: Carlos Santos <unixmania>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.txt none

Description Carlos Santos 2008-02-19 03:50:01 UTC
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.

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:
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
Comment 1 Martin Wilke freebsd_committer freebsd_triage 2008-02-19 08:41:51 UTC
State Changed
From-To: open->closed

Committed. Thanks!