Giter Site home page Giter Site logo

Comments (12)

seanm avatar seanm commented on August 22, 2024 1

Ok, I'll attempt a patch.

from double-conversion.

floitsch avatar floitsch commented on August 22, 2024

I added the -Wzero-as-null-pointer-constant flag to the build and didn't see any warnings.

Would it not be safe to just add the warning?

from double-conversion.

seanm avatar seanm commented on August 22, 2024

That's surprising because this repo does not contain the string nullptr: https://github.com/google/double-conversion/search?q=nullptr When I build, I do get such warnings from clang.

from double-conversion.

seanm avatar seanm commented on August 22, 2024

@floitsch maybe you need to explicitly specify a newer C++ version with say -std=c++17 for the warning flag to do anything.

But the question remains: What is the minimum C++ dialect this project supports?

from double-conversion.

floitsch avatar floitsch commented on August 22, 2024

I must have done something wrong.
Tried again (this time with clang) and now I get warnings.

I never really thought about a minimum version, but I guess C++11 is fine.

Really a pity, that one can't just #define NULL nullptr...

from double-conversion.

seanm avatar seanm commented on August 22, 2024

many other projects do something like:

#if __cplusplus >= 201103L
#  define DC_NULLPTR nullptr
#else
#  define DC_NULLPTR NULL
#endif

from double-conversion.

floitsch avatar floitsch commented on August 22, 2024

I think that's an acceptable solution.

In my new project we now use null:

constexpr std::nullptr_t null = nullptr;

I think something like that should work here too. (together with the #ifdef when it's not available).

from double-conversion.

seanm avatar seanm commented on August 22, 2024

Is there a .h file already included everywhere, where this can be put?

from double-conversion.

floitsch avatar floitsch commented on August 22, 2024

I don't think there is one yet.
Maybe utils.h.
For simplicity I would put it there, since it's already included in most other sources.

from double-conversion.

seanm avatar seanm commented on August 22, 2024

Sorry, didn't anticipate needing a lawyer. :(

Hopefully someone else can fix the warnings.

Cheers.

from double-conversion.

floitsch avatar floitsch commented on August 22, 2024

The project was created while I worked at Google. This bot is a requirement there. (Tbh, probably for good reasons).

That said: I can override the bot if the changes are small enough.
If you reopen the PR I can commit it.

from double-conversion.

seanm avatar seanm commented on August 22, 2024

The project was created while I worked at Google. This bot is a requirement there. (Tbh, probably for good reasons).

No doubt, but I've made this patch on my employer's time, which technically means involving them, which becomes complicated as you can imagine.

That said: I can override the bot if the changes are small enough.
If you reopen the PR I can commit it.

Done, thanks!

from double-conversion.

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.