Enable more compilation checks in clang

These checks were disabled in Chromium due to historical reason.

Also fix compilation errors as a result of the above mentioned change.

Change-Id: I5d240f2f11aa5920598f954d696a15bdcbf78fd8
This commit is contained in:
KongQun Yang 2014-07-02 09:58:40 -07:00 committed by Gerrit Code Review
parent cb12a2bad2
commit 301f8c134d
12 changed files with 68 additions and 93 deletions

33
common.gypi Normal file
View File

@ -0,0 +1,33 @@
# Copyright 2014 Google Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
#
# This file contains common settings for building packager components.
{
'variables': {
# Compile as Chromium code to enable warnings and warnings-as-errors.
'chromium_code': 1,
},
'target_defaults': {
'include_dirs': [
'.',
],
'conditions': [
['clang==1', {
# Revert the relevant settings in Chromium's common.gypi.
'cflags!': [
'-Wno-char-subscripts',
'-Wno-unneeded-internal-declaration',
'-Wno-covered-switch-default',
# C++11-related flags:
'-Wno-c++11-narrowing',
'-Wno-reserved-user-defined-literal',
],
}],
],
},
}

View File

@ -13,9 +13,11 @@
namespace media { namespace media {
#define TAG(a, b, c, d) \ #define TAG(a, b, c, d) \
((static_cast<uint8>(a) << 24) | (static_cast<uint8>(b) << 16) | \ ((static_cast<uint32>(static_cast<uint8>(a)) << 24) | \
(static_cast<uint8>(c) << 8) | (static_cast<uint8>(d))) (static_cast<uint8>(b) << 16) | \
(static_cast<uint8>(c) << 8) | \
(static_cast<uint8>(d)))
#define RCHECK(x) \ #define RCHECK(x) \
do { \ do { \

View File

@ -5,15 +5,9 @@
# https://developers.google.com/open-source/licenses/bsd # https://developers.google.com/open-source/licenses/bsd
{ {
'variables': { 'includes': [
# Compile as chromium code to enable warnings and warnings-as-errors. '../../common.gypi',
'chromium_code': 1, ],
},
'target_defaults': {
'include_dirs': [
'../..',
],
},
'targets': [ 'targets': [
{ {
'target_name': 'base', 'target_name': 'base',

View File

@ -5,15 +5,9 @@
# https://developers.google.com/open-source/licenses/bsd # https://developers.google.com/open-source/licenses/bsd
{ {
'variables': { 'includes': [
# Compile as chromium code to enable warnings and warnings-as-errors. '../../common.gypi',
'chromium_code': 1, ],
},
'target_defaults': {
'include_dirs': [
'../..',
],
},
'targets': [ 'targets': [
{ {
'target_name': 'media_event', 'target_name': 'media_event',

View File

@ -5,15 +5,9 @@
# https://developers.google.com/open-source/licenses/bsd # https://developers.google.com/open-source/licenses/bsd
{ {
'variables': { 'includes': [
# Compile as chromium code to enable warnings and warnings-as-errors. '../../common.gypi',
'chromium_code': 1, ],
},
'target_defaults': {
'include_dirs': [
'../..',
],
},
'targets': [ 'targets': [
{ {
'target_name': 'file', 'target_name': 'file',

View File

@ -5,15 +5,9 @@
# https://developers.google.com/open-source/licenses/bsd # https://developers.google.com/open-source/licenses/bsd
{ {
'variables': { 'includes': [
# Compile as chromium code to enable warnings and warnings-as-errors. '../../common.gypi',
'chromium_code': 1, ],
},
'target_defaults': {
'include_dirs': [
'../..',
],
},
'targets': [ 'targets': [
{ {
'target_name': 'filters', 'target_name': 'filters',

View File

@ -5,15 +5,9 @@
# https://developers.google.com/open-source/licenses/bsd # https://developers.google.com/open-source/licenses/bsd
{ {
'variables': { 'includes': [
# Compile as chromium code to enable warnings and warnings-as-errors. '../../../common.gypi',
'chromium_code': 1, ],
},
'target_defaults': {
'include_dirs': [
'../../..',
],
},
'targets': [ 'targets': [
{ {
'target_name': 'mp2t', 'target_name': 'mp2t',

View File

@ -5,15 +5,9 @@
# https://developers.google.com/open-source/licenses/bsd # https://developers.google.com/open-source/licenses/bsd
{ {
'variables': { 'includes': [
# Compile as chromium code to enable warnings and warnings-as-errors. '../../../common.gypi',
'chromium_code': 1, ],
},
'target_defaults': {
'include_dirs': [
'../../..',
],
},
'targets': [ 'targets': [
{ {
'target_name': 'mp4', 'target_name': 'mp4',

View File

@ -5,15 +5,9 @@
# https://developers.google.com/open-source/licenses/bsd # https://developers.google.com/open-source/licenses/bsd
{ {
'variables': { 'includes': [
# Compile as chromium code to enable warnings and warnings-as-errors. '../../../common.gypi',
'chromium_code': 1, ],
},
'target_defaults': {
'include_dirs': [
'../../..',
],
},
'targets': [ 'targets': [
{ {
'target_name': 'mpeg', 'target_name': 'mpeg',

View File

@ -5,15 +5,9 @@
# https://developers.google.com/open-source/licenses/bsd # https://developers.google.com/open-source/licenses/bsd
{ {
'variables': { 'includes': [
# Compile as chromium code to enable warnings and warnings-as-errors. '../../common.gypi',
'chromium_code': 1, ],
},
'target_defaults': {
'include_dirs': [
'../..',
],
},
'targets': [ 'targets': [
{ {
'target_name': 'run_all_unittests', 'target_name': 'run_all_unittests',

View File

@ -7,15 +7,9 @@
# GYP file for any MPD generation targets. # GYP file for any MPD generation targets.
{ {
'variables': { 'includes': [
# Compile as chromium code to enable warnings and warnings-as-errors. '../common.gypi',
'chromium_code': 1, ],
},
'target_defaults': {
'include_dirs': [
'..',
],
},
'targets': [ 'targets': [
{ {
'target_name': 'media_info_proto', 'target_name': 'media_info_proto',

View File

@ -5,15 +5,9 @@
# https://developers.google.com/open-source/licenses/bsd # https://developers.google.com/open-source/licenses/bsd
{ {
'variables': { 'includes': [
# Compile as chromium code to enable warnings and warnings-as-errors. 'common.gypi',
'chromium_code': 1, ],
},
'target_defaults': {
'include_dirs': [
'.',
],
},
'targets': [ 'targets': [
{ {
'target_name': 'packager', 'target_name': 'packager',