Ticket #319 (closed defect: fixed)
GEOS 3.2.0 fails to build from source in Cygwin 1.7.1 (gcc 4.3.4)
| Reported by: | smonai | Owned by: | pramsey |
|---|---|---|---|
| Priority: | trivial | Milestone: | 3.4.0 |
| Component: | Build/Install | Version: | 3.2.0 |
| Severity: | Unassigned | Keywords: | -ansi snprintf patch |
| Cc: | leethomason@… |
Description
A build initiated with ./configure && make && make install in Cygwin 1.7.1 (gcc 4.3.4) fails within the tests/ subdirectory. The problem is that the -ansi compilation flag filters the prototype of snprintf() out of stdio.h, causing the compilation of tests/xmltester/tinyxml/tinyxml.cpp to fail, with error messages stating:
'snprintf' was not declared in this scope
This error is actually correct behaviour on the compiler's part, since snprintf() is not described in the C89/C++98 ISO standards, and the -ansi flag is intended to enforce precisely those standards.
I have attached a patch to tests/xmltester/tinyxml/tinyxml.h which allows the build to succeed. I believe the patch should not interfere with proper building on non-Cygwin platforms, although I have not tested this.

