DragonFly BSD
DragonFly bugs List (threaded) for 2012-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

[DragonFlyBSD - Bug #2461] INT64_MAX, INT64_MIN long long definition conflicts on x86_64 with firefox 17.0esr build


From: David Shao via Redmine <bugtracker-admin@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 24 Nov 2012 13:46:24 -0800

Issue #2461 has been reported by David Shao.

----------------------------------------
Bug #2461: INT64_MAX,INT64_MIN long long definition conflicts on x86_64 with firefox 17.0esr build
http://bugs.dragonflybsd.org/issues/2461

Author: David Shao
Status: New
Priority: Normal
Assignee: 
Category: 
Target version: 


On current pkgsrc master, 3.3-DEVELOPMENT x86_64, building devel/xulrunner, associated with firefox 17.0esr, fails processing a C++ header file with an error message:

In file included from ../../dist/include/mozilla/FunctionTimer.h:11,
                 from /usr/pkgsrc/devel/xulrunner/work/mozilla-esr17/xpcom/glue/FileUtils.cpp:20:
../../dist/include/mozilla/TimeStamp.h: In static member function 'static mozilla::TimeDuration mozilla::TimeDuration::FromTicks(double)':
../../dist/include/mozilla/TimeStamp.h:137: error: call of overloaded 'FromTicks(long long int)' is ambiguous
../../dist/include/mozilla/TimeStamp.h:123: note: candidates are: static mozilla::TimeDuration mozilla::TimeDuration::FromTicks(int64_t)
../../dist/include/mozilla/TimeStamp.h:129: note:                 static mozilla::TimeDuration mozilla::TimeDuration::FromTicks(double)
gmake[4]: *** [FileUtils.o] Error 1

The relevant lines from the original TimeStamp.h located under devel/xulrunner/work/mozilla-esr17/xpcom/ds appear to be:

  static TimeDuration FromTicks(int64_t aTicks) {
    TimeDuration t;
    t.mValue = aTicks;
    return t;
  }

  static TimeDuration FromTicks(double aTicks) {
    // NOTE: this MUST be a >= test, because int64_t(double(INT64_MAX))
    // overflows and gives LL_MININT.
    if (aTicks >= double(INT64_MAX))
      return TimeDuration::FromTicks(INT64_MAX);

    // This MUST be a <= test.
    if (aTicks <= double(INT64_MIN))
      return TimeDuration::FromTicks(INT64_MIN);

    return TimeDuration::FromTicks(int64_t(aTicks));
  }

  // Duration in PRIntervalTime units
  int64_t mValue;


A patch explictly casting in the above header file TimeStamp.h both INT64_MAX and INT64_MIN to int64_t allows building to at least proceed past the previous error.

Grepping for INT64_MAX and INT64_MIN under /usr/include reveals definitions:
#define      INT64_MAX       0x7fffffffffffffffLL
#define      INT64_MIN     (-0x7fffffffffffffffLL-1)

The compiler being used is:
$ cc --version
cc (DragonFly) 4.4.7 2012.03.13





-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]