Ticket #2317 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

C++ issue on some archs with GCC 4.3

Reported by: frankie Assigned to: warmerdam
Priority: normal Milestone: 1.5.2
Component: OGR_SF Version: 1.5.0
Severity: normal Keywords: geojson
Cc: warmerdam

Description

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474415

Please avoid the use of such common used max/min macros. It is much better using some unique names such as OGR_max/OGR_min to avoid name clashes.

Change History

04/07/08 08:39:44 changed by warmerdam

  • keywords set to geojson.
  • cc set to warmerdam.
  • version changed from unspecified to 1.5.0.
  • component changed from default to OGR_SF.
  • milestone set to 1.5.2.

I can confirm that geojson/jsonc/bits.h defines min and max macros like this:

#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif

#ifndef max
#define max(a,b) ((a) > (b) ? (a) : (b))
#endif

This is a dangerous practice. This needs to be reworked to do something else, likely just use the MIN/MAX defined in cpl_port.h or rename the macros something specific. Matuesz, if you don't have time to deal with this shortly, let me know and I'll have Chris address it.

04/07/08 11:15:50 changed by frankie

This seems fixed in trunk, I backported a patch in 1.5.1-2 on Debian, thanks. See changesets 13700 and 13701.

04/13/08 06:19:07 changed by rouault

  • status changed from new to closed.
  • resolution set to fixed.

Francesco,

I've backported r13700 and r13701 from trunk to branches/1.5 (r14283). So you should be able to drop your patch when packaging 1.5.2 ;-)