Merge "Use -Werror in frameworks/base" am: 16fbd3a1d8 am: 0bfb717a37
am: 9f004b1752
Change-Id: I6517ee1689b0247caf830a6c3528bfa9bcf91f75
This commit is contained in:
@@ -34,6 +34,11 @@ cc_library {
|
|||||||
include_dirs: ["external/protobuf/src"],
|
include_dirs: ["external/protobuf/src"],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
cflags: [
|
||||||
|
"-Wall",
|
||||||
|
"-Werror",
|
||||||
|
"-Wno-unused-parameter",
|
||||||
|
],
|
||||||
target: {
|
target: {
|
||||||
host: {
|
host: {
|
||||||
proto: {
|
proto: {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
cc_library_host_static {
|
cc_library_host_static {
|
||||||
name: "libinstrumentation",
|
name: "libinstrumentation",
|
||||||
srcs: ["**/*.proto"],
|
srcs: ["**/*.proto"],
|
||||||
|
cflags: ["-Wall", "-Werror"],
|
||||||
proto: {
|
proto: {
|
||||||
type: "full",
|
type: "full",
|
||||||
export_proto_headers: true,
|
export_proto_headers: true,
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ cc_binary_host {
|
|||||||
"util.cpp",
|
"util.cpp",
|
||||||
],
|
],
|
||||||
|
|
||||||
|
cflags: [
|
||||||
|
"-Wall",
|
||||||
|
"-Werror",
|
||||||
|
],
|
||||||
|
|
||||||
static_libs: [
|
static_libs: [
|
||||||
"libexpat",
|
"libexpat",
|
||||||
"libinstrumentation",
|
"libinstrumentation",
|
||||||
|
|||||||
@@ -302,7 +302,9 @@ run_instrumentation_test(const string& packageName, const string& runner, const
|
|||||||
print_command(cmd);
|
print_command(cmd);
|
||||||
|
|
||||||
int fds[2];
|
int fds[2];
|
||||||
pipe(fds);
|
if (0 != pipe(fds)) {
|
||||||
|
return errno;
|
||||||
|
}
|
||||||
|
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,9 @@ get_command_output(const Command& command, int* err, bool quiet)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int fds[2];
|
int fds[2];
|
||||||
pipe(fds);
|
if (0 != pipe(fds)) {
|
||||||
|
return string();
|
||||||
|
}
|
||||||
|
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
|
|
||||||
|
|||||||
@@ -596,6 +596,15 @@ check_device_property(const string& property, const string& expected)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
chdir_or_exit(const char *path) {
|
||||||
|
// TODO: print_command("cd", path);
|
||||||
|
if (0 != chdir(path)) {
|
||||||
|
print_error("Error: Could not chdir: %s", path);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the build, install, and test actions.
|
* Run the build, install, and test actions.
|
||||||
*/
|
*/
|
||||||
@@ -618,8 +627,7 @@ run_phases(vector<Target*> targets, const Options& options)
|
|||||||
const string buildId = get_build_var(buildTop, "BUILD_ID", false);
|
const string buildId = get_build_var(buildTop, "BUILD_ID", false);
|
||||||
const string buildOut = get_out_dir();
|
const string buildOut = get_out_dir();
|
||||||
|
|
||||||
// TODO: print_command("cd", buildTop.c_str());
|
chdir_or_exit(buildTop.c_str());
|
||||||
chdir(buildTop.c_str());
|
|
||||||
|
|
||||||
// Get the modules for the targets
|
// Get the modules for the targets
|
||||||
map<string,Module> modules;
|
map<string,Module> modules;
|
||||||
@@ -999,7 +1007,7 @@ run_tab_completion(const string& word)
|
|||||||
const string buildProduct = get_required_env("TARGET_PRODUCT", false);
|
const string buildProduct = get_required_env("TARGET_PRODUCT", false);
|
||||||
const string buildOut = get_out_dir();
|
const string buildOut = get_out_dir();
|
||||||
|
|
||||||
chdir(buildTop.c_str());
|
chdir_or_exit(buildTop.c_str());
|
||||||
|
|
||||||
string buildDevice = sniff_device_name(buildOut, buildProduct);
|
string buildDevice = sniff_device_name(buildOut, buildProduct);
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ TrackedFile::HasChanged() const
|
|||||||
void
|
void
|
||||||
get_directory_contents(const string& name, map<string,FileInfo>* results)
|
get_directory_contents(const string& name, map<string,FileInfo>* results)
|
||||||
{
|
{
|
||||||
int err;
|
|
||||||
DIR* dir = opendir(name.c_str());
|
DIR* dir = opendir(name.c_str());
|
||||||
if (dir == NULL) {
|
if (dir == NULL) {
|
||||||
return;
|
return;
|
||||||
@@ -241,7 +240,9 @@ read_file(const string& filename)
|
|||||||
fseek(file, 0, SEEK_SET);
|
fseek(file, 0, SEEK_SET);
|
||||||
|
|
||||||
char* buf = (char*)malloc(size);
|
char* buf = (char*)malloc(size);
|
||||||
fread(buf, 1, size, file);
|
if ((size_t) size != fread(buf, 1, size, file)) {
|
||||||
|
return string();
|
||||||
|
}
|
||||||
|
|
||||||
string result(buf, size);
|
string result(buf, size);
|
||||||
|
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ cc_binary_host {
|
|||||||
"libprotobuf-cpp-full",
|
"libprotobuf-cpp-full",
|
||||||
],
|
],
|
||||||
|
|
||||||
cflags: ["-Wno-unused-parameter"],
|
cflags: ["-Wall", "-Werror"],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ Out::printf(const char* format, ...)
|
|||||||
|
|
||||||
len = vsnprintf(mBuf, mBufSize, format, args);
|
len = vsnprintf(mBuf, mBufSize, format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
bool truncated = (len >= mBufSize) && (reallocate(len) < len);
|
|
||||||
|
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
len = vsnprintf(mBuf, mBufSize, format, args);
|
len = vsnprintf(mBuf, mBufSize, format, args);
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ cc_binary_host {
|
|||||||
cflags: [
|
cflags: [
|
||||||
"-g",
|
"-g",
|
||||||
"-O0",
|
"-O0",
|
||||||
|
"-Wall",
|
||||||
|
"-Werror",
|
||||||
],
|
],
|
||||||
srcs: ["main.cpp"],
|
srcs: ["main.cpp"],
|
||||||
shared_libs: [
|
shared_libs: [
|
||||||
|
|||||||
Reference in New Issue
Block a user