Opened 16 years ago
Closed 9 years ago
#2402 closed defect (fixed)
Alternative to casting everything in r14607
Reported by: | hobu | Owned by: | hobu |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | SWIG (all bindings) | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: | tamas, Ari Jolma |
Description
Frank,
Here's a patch I came up with against source:/trunk/gdal/swig/include/ogr.i@14600 that seems to cure the compiling errors in the java bindings when building -DDEBUG. Do you think this is appropriate (sorry to attempt to undo your tedium, but I'd really like to avoid having casts all over the place in the swig interface code if we can avoid it)?
Attachments (1)
Change History (9)
by , 16 years ago
Attachment: | javapatch.patch added |
---|
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Cc: | added |
---|---|
Component: | JavaBindings → SWIG (all bindings) |
Owner: | changed from | to
I would support that. Adding Tamas and Ari in case they have anything to add.
follow-up: 6 comment:4 by , 16 years ago
Status: | new → assigned |
---|
Ok, osr.i and ogr.i were updated in r14634. Now the question is whether or not these should be structs for the more rigorous type safety all of the time instead of just -DDEBUG. Ari and Tamas?
comment:5 by , 16 years ago
There are invalid conversion errors in CreateGeometryFromWkb, CreateGeometryFromWkt, and BuildPolygonFromEdges, when compiling with these typedef structs. Otherwise ok. I'm for more rigorous type safety, but not very strongly.
comment:6 by , 16 years ago
Replying to hobu:
Ok, osr.i and ogr.i were updated in r14634. Now the question is whether or not these should be structs for the more rigorous type safety all of the time instead of just -DDEBUG. Ari and Tamas?
I would support applying this to the nondebug configuration as well. I`m not totally sure about the possible issues may be triggered, but we can revert the changes if serious problems are happening. C# can currently compile with -DDEBUG setting.
I cannot imagine who use the DEBUG switch in practice, but shouldn`t we add this setting to the compiler command line if the DEBUG option is specified in the makefile? Or is everyone use EXTRAFLAGS=-DDEBUG for this purpose?
Tamas
comment:7 by , 9 years ago
If I understand right, the issue was in "compiling errors in the java bindings when building -DDEBUG."
Have such errors occurred all these 7 years or can this ticket be closed as fixed?
comment:8 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The original problem was fixed by Hobu but Even's suggestion (which to me seems to be a much bigger issue since the type safety stuff concerned is not just in Swig but also in OGR.
I'm closing this.
Why not defining 'typedef struct OGRSpatialReferenceHS OSRSpatialReferenceShadow' and so on, even on non DEBUG builds ? It should work too, shoudln't it ? And it would save the conditionnal compilation.