Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Issue 657183002: Don't use 'defined' in macro expansion. (Closed)

Created:
6 years, 2 months ago by bungeman-skia
Modified:
6 years, 2 months ago
Reviewers:
mtklein, reed1
CC:
reviews_skia.org, ukai
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Don't use 'defined' in macro expansion. A careful reading of the preprocessor specification indicates that any use of the 'defined' operator outside the form of 'defined X' or 'defined ( X )' directly in the constant expression of a '#if' or '#elif' may cause undefined behavior. In particular, msvc is very unpredictable. The 'defined X' and 'defined ( X )' forms behave differently when created from marco expansion, with 'defined ( X )' generally evaluating to '0L'. The 'defined X' form generally behaves more the way one would expect, but still has a number of quirks which should simply be considered undefined behavior. BUG=chromium:419245 Committed: https://skia.googlesource.com/skia/+/8dfdfff98dd14b0f3bef465411941e1bab8f0261

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -4 lines) Patch
M include/core/SkFloatingPoint.h View 1 chunk +6 lines, -2 lines 0 comments Download
M include/core/SkPostConfig.h View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
bungeman-skia
6 years, 2 months ago (2014-10-15 19:51:16 UTC) #2
mtklein
lgtm
6 years, 2 months ago (2014-10-15 19:52:40 UTC) #3
reed1
lgtm
6 years, 2 months ago (2014-10-15 20:42:21 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/657183002/1
6 years, 2 months ago (2014-10-15 20:44:02 UTC) #6
commit-bot: I haz the power
6 years, 2 months ago (2014-10-15 20:54:05 UTC) #7
Message was sent while issue was closed.
Committed patchset #1 (id:1) as 8dfdfff98dd14b0f3bef465411941e1bab8f0261

Powered by Google App Engine
This is Rietveld 408576698