Giter VIP home page Giter VIP logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024
Thanks for the report.  I thought I had compiled this on a 64-bit machine before
releasing, but maybe not.

When I do try building on an x86_64 machine with gcc 4.2.2, I don't get the 
warnings
you mentioned.  We define int64 to be int64_t, which it seems to me should work 
with
%lld, but maybe it doesn't on some systems.

I know how to solve this kind of problem in general, but I wish I could 
reproduce the
problem to make sure my solution works.

Can you give more details on what OS and compiler you're using?

Original comment by [email protected] on 10 Jul 2008 at 11:58

from gflags.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024
This is a similar situation to issue 12. If you are using a build system that 
treats
warnings as errors on a 64 bit system (you can simulate this with the supplied 
build
system by running ./configure CXXFLAGS="-Wall -Werror -O2 -g" before make), 
besides
the signedness warnings in issue 12 you will receive the warning mentioned 
originally
in this issue.

The supplied build system (./configure && make) works just fine, but this issue 
is
for cases in which the supplied build system is replaced with another for 
various
reasons.

If this issue is a situation in which a given warning is something Google 
explicitly
ignores, that's okay, but perhaps this is something that can be cleanly fixed 
for
everyone.

Thanks. :)

Original comment by jtolds on 16 Jul 2008 at 12:13

from gflags.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024
Hmm, not sure if it's the same as issue 12, since correctness could be affected 
in
this case.  But I'm not sure.

I can't reproduce the problem on my 64-bit system, so I'm not exactly sure what 
the
issue is, so I'm marking this Won't Fix for now.  Feel free to reopen if you 
start to
see problems with this.

Original comment by [email protected] on 23 Jul 2008 at 12:24

  • Changed state: WontFix

from gflags.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024
I'd re-open this if I knew how, but I know the source of this warning.
Using http://gcc.gnu.org/ml/gcc-help/2008-07/msg00029.html for my hunch, I 
believe
the problem is that on 64-bit systems, int_64_t is typedef'd to long int, not 
long
long int.

I notice on my system (debian/etch, gcc 4.3.1 ):
 sizeof(int) == 4
 sizeof(long int) == 8
 sizeof(long long int) == 8

So, luckily, the warning won't cause any problems.  But it appears that on 
64-bit
systems, the appropriate printf format would be "%ld", not "%lld".

Original comment by [email protected] on 5 Aug 2008 at 3:10

from gflags.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024
Indeed from /usr/include/stdint.h from the libc6-dev package on debian/testing 
amd64:

# if __WORDSIZE == 64
typedef long int        int64_t;
# else
__extension__
typedef long long int       int64_t;
#endif

Original comment by [email protected] on 5 Aug 2008 at 3:15

from gflags.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024
Gotcha.  OK, this is pretty easy to fix.  In the next gflags release, I'll 
replace
%lld with the PRId64 macro, which is standard and written to address just this 
problem.

Original comment by [email protected] on 5 Aug 2008 at 10:19

  • Changed state: Started

from gflags.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024
Fixed in gflags 1.0rc1.

Original comment by [email protected] on 21 Aug 2008 at 12:56

  • Changed state: Fixed

from gflags.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.