Bug 120830 - ensure that x11/xautolock compile with restrictive GCC arguments
Summary: ensure that x11/xautolock compile with restrictive GCC arguments
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
Depends on:
Reported: 2008-02-19 03:50 UTC by Carlos Santos
Modified: 2008-02-20 02:20 UTC (History)
0 users

See Also:

file.txt (981 bytes, application/octet-stream)
2008-02-19 03:50 UTC, Carlos Santos
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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
#ifndef DefaultCCOptions
# define DefaultCCOptions       -ansi -pedantic -Dasm=__asm__ -Dinline=__inline__ GccWarningOptions

2. Attempt to build x11/xautolock
Comment 1 Martin Wilke freebsd_committer 2008-02-19 08:41:51 UTC
State Changed
From-To: open->closed

Committed. Thanks!