[postgis-tickets] [PostGIS] #3206: winnie crashing with topology ST_AddModeFace in C commit 9.3 w32 bit run
PostGIS
trac at osgeo.org
Fri Jul 31 16:58:57 PDT 2015
#3206: winnie crashing with topology ST_AddModeFace in C commit 9.3 w32 bit run
-----------------------+---------------------------
Reporter: robe | Owner: strk
Type: defect | Status: new
Priority: blocker | Milestone: PostGIS 2.2.0
Component: topology | Version: trunk
Resolution: | Keywords:
-----------------------+---------------------------
Comment (by robe):
strk at a glance my guess is the cause of the remaining issues are in
lwerror calls because of the non-standard PRI64d of windows, so we've got
to get rid of those, but not sure what to replace with. :).
More wisdom from Tom Lane: http://www.postgresql.org/message-
id/13415.1438386185 at sss.pgh.pa.us
----
>> Huh. Apparently, whichever Windows compiler you're using defines
>> PRId64 as "d", which surely seems pretty broken.
> I think it was only failing on the postgresql function calls.
> And this: gcc -Wall -E testint.c | grep '\(printf.*x)\| int64_t;\)'
> Returned:
> __extension__ typedef long long int64_t;
> printf("%" "I64d", x);
Oooh ... so the issue is the nonstandard "I64" length modifier.
Now I understand. That probably works fine with Microsoft's printf, but
(1) gcc does not understand it, which is why you're getting the compile
warnings with the erroneous claim that the format is just "d", and
(2) our implementation of snprintf doesn't understand it either, which
presumably is causing weird runtime behavior for you when you try to use
this with StringInfo functions.
Adherence to standards was never MS' strong point was it.
Anyway, it would be advisable to switch your declarations to use PG's
int64 if you are going to use INT64_FORMAT. If you use that macro with a
platform-provided int64_t declaration then you are going to get compile
warnings on some platforms; that is exactly the point that Andres was
making in the previous discussion.
regards, tom lane
----
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3206#comment:33>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list