Ticket #2317 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

C++ issue on some archs with GCC 4.3

Reported by: frankie Owned by: 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

Changed 5 years ago by warmerdam

  • cc warmerdam added
  • keywords geojson added
  • 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.

Changed 5 years ago by frankie

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

Changed 5 years ago 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 ;-)

Note: See TracTickets for help on using tickets.