Introduce a new macro CGAL_SUNPRO_INITIALIZE to workaround a SunPRO warning properly.

(can't write a test program for a warning)
This commit is contained in:
Sylvain Pion 2008-01-20 21:39:25 +00:00
parent f3d7319465
commit a8243a3f12
2 changed files with 14 additions and 18 deletions

View File

@ -136,6 +136,14 @@
#endif #endif
#ifdef __SUNPRO_CC
// SunPRO 5.9 emits warnings "The variable tag has not yet been assigned a value"
// even for empty "tag" variables. No way to write a config/testfile for this.
# define CGAL_SUNPRO_INITIALIZE(C) C
#else
# define CGAL_SUNPRO_INITIALIZE(C)
#endif
//-------------------------------------------------------------------// //-------------------------------------------------------------------//
// When the global min and max are no longer defined (as macros) // When the global min and max are no longer defined (as macros)

View File

@ -158,12 +158,8 @@ public:
bool bool
operator()(const Rectangle_2& p, const Rectangle_2& q) const operator()(const Rectangle_2& p, const Rectangle_2& q) const
{ {
typename Kernel::Rep_tag tag; typedef typename Kernel::Rep_tag Rep_tag;
#if defined(__sun) && defined(__SUNPRO_CC) Rep_tag tag CGAL_SUNPRO_INITIALIZE(= Rep_tag());
// to avoid a warning "tag has not yet been assigned a value"
typedef typename Kernel::Rep_tag Rep_tag;
tag = Rep_tag();
#endif // SUNPRO
return area_numerator(p, tag) * area_denominator(q, tag) < return area_numerator(p, tag) * area_denominator(q, tag) <
area_denominator(p, tag) * area_numerator(q, tag); area_denominator(p, tag) * area_numerator(q, tag);
} }
@ -207,12 +203,8 @@ public:
bool bool
operator()(const Parallelogram_2& p, const Parallelogram_2& q) const operator()(const Parallelogram_2& p, const Parallelogram_2& q) const
{ {
typename Kernel::Rep_tag tag; typedef typename Kernel::Rep_tag Rep_tag;
#if defined(__sun) && defined(__SUNPRO_CC) Rep_tag tag CGAL_SUNPRO_INITIALIZE(= Rep_tag());
// to avoid a warning "tag has not yet been assigned a value"
typedef typename Kernel::Rep_tag Rep_tag;
tag = Rep_tag();
#endif // SUNPRO
return area_numerator(p, tag) * area_denominator(q, tag) < return area_numerator(p, tag) * area_denominator(q, tag) <
area_denominator(p, tag) * area_numerator(q, tag); area_denominator(p, tag) * area_numerator(q, tag);
} }
@ -251,12 +243,8 @@ public:
bool bool
operator()(const Strip_2& p, const Strip_2& q) const operator()(const Strip_2& p, const Strip_2& q) const
{ {
typename Kernel::Rep_tag tag; typedef typename Kernel::Rep_tag Rep_tag;
#if defined(__sun) && defined(__SUNPRO_CC) Rep_tag tag CGAL_SUNPRO_INITIALIZE(= Rep_tag());
// to avoid a warning "tag has not yet been assigned a value"
typedef typename Kernel::Rep_tag Rep_tag;
tag = Rep_tag();
#endif // SUNPRO
return width_numerator(p, tag) * width_denominator(q, tag) < return width_numerator(p, tag) * width_denominator(q, tag) <
width_denominator(p, tag) * width_numerator(q, tag); width_denominator(p, tag) * width_numerator(q, tag);
} }