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

Issue 1069433002: Don't #define snprintf in VS 2015 builds. (Closed)

Created:
5 years, 8 months ago by brucedawson
Modified:
5 years, 8 months ago
Reviewers:
Lei Zhang, scottmg
CC:
chromium-reviews, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Don't #define snprintf in VS 2015 builds. The function snprintf is not available in Visual Studio prior to VS 2015. In some places this omission is dealt with with a #define to map snprintf to _snprintf. This was never a good idea (_snprintf doesn't guarantee null-termination) and with VS 2015 it is not even legal. This change conditionally disables one instance of this remapping. The build errors that occur without this change are: stdio.h(1926): warning C4005: 'snprintf': macro redefinition stdio.h(1926): note: command-line arguments: see previous definition of 'snprintf' stdio.h(1929): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration R=scottmg@chromium.org BUG=440500 Committed: https://crrev.com/2622e27d880e88b21d8eceb98b6863cdf6dc9afd Cr-Commit-Position: refs/heads/master@{#324157}

Patch Set 1 #

Patch Set 2 : Fix snprintf definition for libexif also. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -5 lines) Patch
M content/content_shell.gypi View 1 chunk +8 lines, -3 lines 0 comments Download
M third_party/libexif/libexif.gyp View 1 1 chunk +9 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
brucedawson
Working through blocking issues...
5 years, 8 months ago (2015-04-07 20:22:35 UTC) #2
brucedawson
Scott, can you verify the .gyp/VS goodness of this? vandebo@ can you okay the libexif ...
5 years, 8 months ago (2015-04-07 20:47:10 UTC) #4
vandebo (ex-Chrome)
-> thestig@
5 years, 8 months ago (2015-04-07 20:50:04 UTC) #6
scottmg
lgtm
5 years, 8 months ago (2015-04-07 21:23:13 UTC) #7
Lei Zhang
lgtm
5 years, 8 months ago (2015-04-07 21:38:17 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1069433002/20001
5 years, 8 months ago (2015-04-07 21:44:15 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 8 months ago (2015-04-08 00:14:17 UTC) #11
commit-bot: I haz the power
5 years, 8 months ago (2015-04-08 00:15:15 UTC) #12
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/2622e27d880e88b21d8eceb98b6863cdf6dc9afd
Cr-Commit-Position: refs/heads/master@{#324157}

Powered by Google App Engine
This is Rietveld 408576698