Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#846 closed defect (fixed)

UTF8 BOM in headers ?

Reported by: landry Owned by: geos-devel@…
Priority: major Milestone: 3.6.3
Component: Default Version: 3.6.2
Severity: Unassigned Keywords:
Cc:

Description

I have a build failure for 3.6.2 on sparc64 using gcc4.9; see http://build-failures.rhaalovely.net//sparc64/2017-11-12/geo/geos.log for the full log, but the interesting part is:

../../../include/geos/geom/Polygonal.h:1: error: stray '\357' in program
../../../include/geos/geom/Polygonal.h:1: error: stray '\273' in program
../../../include/geos/geom/Polygonal.h:1: error: stray '\277' in program
In file included from ../../../include/geos/geom/MultiPolygon.h:29,
                 from IndexedPointInAreaLocator.cpp:19:
../../../include/geos/geom/Polygonal.h:1: error: stray '\357' in program
../../../include/geos/geom/Polygonal.h:1: error: stray '\273' in program
../../../include/geos/geom/Polygonal.h:1: error: stray '\277' in program
In file included from ../../../include/geos/geom/LineString.h:27,
                 from IndexedPointInAreaLocator.cpp:20:
../../../include/geos/geom/Lineal.h:1: error: stray '\357' in program
../../../include/geos/geom/Lineal.h:1: error: stray '\273' in program
../../../include/geos/geom/Lineal.h:1: error: stray '\277' in program
In file included from ../../../include/geos/util/IllegalArgumentException.h:22,
                 from IndexedPointInAreaLocator.cpp:25:
../../../include/geos/util/GEOSException.h:1: error: stray '\357' in program
../../../include/geos/util/GEOSException.h:1: error: stray '\273' in program
../../../include/geos/util/GEOSException.h:1: error: stray '\277' in program


$file include/geos/*/*|grep ISO
include/geos/geom/Lineal.h:                                   ISO-8859 English text
include/geos/geom/Polygonal.h:                                ISO-8859 English text
include/geos/geom/Puntal.h:                                   ISO-8859 English text
include/geos/util/GEOSException.h:                            ISO-8859 English text

It seems those files start with an utf8 BOM:

$head -1 include/geos/geom/Lineal.h |hexdump
0000000    bbef    2fbf    2a2a
$head -1 include/geos/geom/IntersectionMatrix.h |hexdump
0000000    2a2f    2a2a    2a2a

Pretty sure removing those wrong chars will fix my build.. either way they shouldnt be here :)

Change History (15)

comment:1 by landry, 6 years ago

Err sorry that is with gcc 4.2.1 (yeah i know ancient)

comment:2 by Sandro Santilli <strk@…>, 6 years ago

Resolution: fixed
Status: newclosed

In 11476b5/git:

Remove BOM from header files

It was accidentally added by fbb4431f84ba516b873961b373567ae79a1d92e2

Fixes #846

comment:3 by Sandro Santilli <strk@…>, 6 years ago

In b5c0141/git:

Another BOM removed

This one was added in dbc52d41fd43bb9bdec31fc9969a66d05bc4bf95

See #846

comment:4 by strk, 6 years ago

Please check if [dbc52d41fd43bb9bdec31fc9969a66d05bc4bf95/git] builds fine there.

comment:5 by landry, 6 years ago

Hmmm well i saw the issue on 3.6 branch, and the fixes are on trunk/master, where there's now a requirement for c++1, which will force the use of a recent/decent compiler, which will support UTF-8 BOM (as that's already the case on amd64/i386 for OpenBSD) - so that should work in all cases now, but i cant really test now, unless the commits are backported to 3.6.

Either way, thanks for fixing it!

comment:6 by Sandro Santilli <strk@…>, 6 years ago

In a1f79c73/git:

Remove BOM from header files

It was accidentally added by fbb4431f84ba516b873961b373567ae79a1d92e2

Fixes #846

comment:7 by Sandro Santilli <strk@…>, 6 years ago

In 78913af1/git:

Another BOM removed

This one was added in dbc52d41fd43bb9bdec31fc9969a66d05bc4bf95

See #846

comment:8 by strk, 6 years ago

Please check with 04a19a5d, in svn-3.6 branch

Version 0, edited 6 years ago by strk (next)

comment:9 by landry, 6 years ago

Hah, there's another bunch (in 3.6 branch):

CGAlgorithms.cpp:1: error: stray '\357' in program
CGAlgorithms.cpp:1: error: stray '\273' in program
CGAlgorithms.cpp:1: error: stray '\277' in program

LineIntersector.cpp:1: error: stray '\357' in program
LineIntersector.cpp:1: error: stray '\273' in program
LineIntersector.cpp:1: error: stray '\277' in program
...
...

To find them all, some shell fu helps

find src/ include/ |while read f ; do file $f ; done |grep ISO
src/algorithm/CGAlgorithms.cpp: ISO-8859 English text
src/algorithm/LineIntersector.cpp: ISO-8859 English text
src/geom/IntersectionMatrix.cpp: ISO-8859 English text
include/geos/index/strtree/AbstractSTRtree.h: ISO-8859 English text


With those 4 files locally fixed, git branch svn-3.6 builds fine with g++ 4.2.1 on OpenBSD/amd64.

comment:10 by Mateusz Loskot <mateusz@…>, 6 years ago

In c292ffd/git:

Remove BOM mark

Fixes #846

comment:12 by Mateusz Loskot <mateusz@…>, 6 years ago

In c292ffd/git:

Remove BOM mark

Fixes #846

comment:13 by Sandro Santilli <strk@…>, 6 years ago

In b0690d0/git:

Remove BOM mark

Fixes #846

comment:14 by strk, 6 years ago

Landry is it fine now ? [b0690d0cb6/git] in 3.6 branch

comment:15 by landry, 6 years ago

Yep, incremental built went fine here.. thanks !

Note: See TracTickets for help on using tickets.