Fwd: [webkit-dev] on coding-style

54 views
Skip to first unread message

Eric Seidel

unread,
Apr 12, 2013, 6:44:44 PM4/12/13
to blink-dev, Nico Weber
Can we update our style to use nullptr now?

It's not clear to me if we're using a new enough MSVC or not?


---------- Forwarded message ----------
From: Benjamin Poulain <benj...@webkit.org>
Date: Fri, Apr 12, 2013 at 3:41 PM
Subject: Re: [webkit-dev] on coding-style
To: Karen Shaeffer <shae...@neuralscape.com>
Cc: WebKit Development <webki...@lists.webkit.org>


On Fri, Apr 12, 2013 at 3:33 PM, Karen Shaeffer
<shae...@neuralscape.com> wrote:
>
> Was reading the coding-style documentation. Have just one question concerning
> C++ null pointer value. Quoting the coding-style docs, "In C++, the null pointer
> value should be written as 0."
>
> My question is: Doesn't xcode clang now support features like nullptr? Shouldn't
> the coding-style documentation be updated to use nullptr?


The problem is the variety of compilers used by the various ports
(WebKit is also used on Windows, Linux, Solaris, etc.), not all of
them supports nullptr.

You can already use nullptr with some types (RefPtr, OwnPtr, etc).
That is thanks to a hack in Source/WTF/wtf/NullPtr.h

Cheers,
Benjamin

_______________________________________________
webkit-dev mailing list
webki...@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev

Peter Kasting

unread,
Apr 12, 2013, 6:52:15 PM4/12/13
to Eric Seidel, blink-dev, Nico Weber
On Fri, Apr 12, 2013 at 3:44 PM, Eric Seidel <ese...@chromium.org> wrote:
Can we update our style to use nullptr now?

It's not clear to me if we're using a new enough MSVC or not?

I believe MSVC 2010 (which we support) doesn't do any of C++11?  I could be wrong though.

I think we've so far avoided C++11isms in the rest of the codebase.

PK 

Nico Weber

unread,
Apr 12, 2013, 6:59:04 PM4/12/13
to Eric Seidel, blink-dev
On Fri, Apr 12, 2013 at 3:44 PM, Eric Seidel <ese...@chromium.org> wrote:
Can we update our style to use nullptr now?

No.
 
It's not clear to me if we're using a new enough MSVC or not?

nullptr is a C++11 feature, and a library feature too. There has been a long thread about this on chromium-dev: https://groups.google.com/a/chromium.org/forum/?fromgroups#!topic/chromium-dev/VX57EI9VwS8

Not much has changed since then. (The precise migration has started, but isn't complete yet. awong is working on Android.)

Eric Seidel

unread,
Apr 12, 2013, 6:59:57 PM4/12/13
to Nico Weber, blink-dev
Thanks for the update!
Reply all
Reply to author
Forward
0 new messages