summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorthakis <thakis@chromium.org>2016-02-02 08:00:21 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-02 16:01:14 +0000
commit6ef06b461ccae125f8c8d6e33dde10c550ff3780 (patch)
tree155819c70246e3f1d11f774f0d8b8d2d65e671f9 /base
parent3f0118e3ef62194270b131e988079b82c0e26b7d (diff)
downloadchromium_src-6ef06b461ccae125f8c8d6e33dde10c550ff3780.zip
chromium_src-6ef06b461ccae125f8c8d6e33dde10c550ff3780.tar.gz
chromium_src-6ef06b461ccae125f8c8d6e33dde10c550ff3780.tar.bz2
Make dynamic_annotations build with -Wconstant-conversion from newer clangs.
After http://llvm.org/viewvc/llvm-project?rev=259271&view=rev, clang points out that lineno is sometimes assigned a value > SHRT_MAX, which causes an overflow. All values are smaller than USHRT_MAX, so just make lineno an unsigned short. No behavior change. BUG=none Review URL: https://codereview.chromium.org/1653973005 Cr-Commit-Position: refs/heads/master@{#372952}
Diffstat (limited to 'base')
-rw-r--r--base/third_party/dynamic_annotations/README.chromium3
-rw-r--r--base/third_party/dynamic_annotations/dynamic_annotations.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/base/third_party/dynamic_annotations/README.chromium b/base/third_party/dynamic_annotations/README.chromium
index ff21b19..c029f8e 100644
--- a/base/third_party/dynamic_annotations/README.chromium
+++ b/base/third_party/dynamic_annotations/README.chromium
@@ -18,3 +18,6 @@ with better precision.
These files were taken from
http://code.google.com/p/data-race-test/source/browse/?#svn/trunk/dynamic_annotations
The files are covered under BSD license as described within the files.
+
+Local modifications:
+* made lineno an unsigned short (for -Wconstant-conversion warning fixes)
diff --git a/base/third_party/dynamic_annotations/dynamic_annotations.c b/base/third_party/dynamic_annotations/dynamic_annotations.c
index f57cb12..4313ecc 100644
--- a/base/third_party/dynamic_annotations/dynamic_annotations.c
+++ b/base/third_party/dynamic_annotations/dynamic_annotations.c
@@ -61,10 +61,10 @@
folding them. */
#ifdef __COUNTER__
#define DYNAMIC_ANNOTATIONS_IMPL \
- volatile short lineno = (__LINE__ << 8) + __COUNTER__; (void)lineno;
+ volatile unsigned short lineno = (__LINE__ << 8) + __COUNTER__; (void)lineno;
#else
#define DYNAMIC_ANNOTATIONS_IMPL \
- volatile short lineno = (__LINE__ << 8); (void)lineno;
+ volatile unsigned short lineno = (__LINE__ << 8); (void)lineno;
#endif
/* WARNING: always add new annotations to the end of the list.