summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src
diff options
context:
space:
mode:
Diffstat (limited to 'native_client_sdk/src')
-rw-r--r--native_client_sdk/src/build_tools/generate_make.py4
-rw-r--r--native_client_sdk/src/build_tools/library.mk8
-rwxr-xr-xnative_client_sdk/src/build_tools/parse_dsc.py3
-rw-r--r--native_client_sdk/src/build_tools/template.mk8
-rw-r--r--native_client_sdk/src/examples/demo/drive/drive.cc5
-rw-r--r--native_client_sdk/src/examples/demo/nacl_io/handlers.c20
-rw-r--r--native_client_sdk/src/examples/tutorial/debugging/example.dsc2
-rw-r--r--native_client_sdk/src/examples/tutorial/testing/example.dsc4
-rw-r--r--native_client_sdk/src/libraries/gmock/library.dsc1
-rw-r--r--native_client_sdk/src/libraries/gtest/library.dsc7
-rw-r--r--native_client_sdk/src/libraries/jsoncpp/library.dsc1
-rw-r--r--native_client_sdk/src/libraries/nacl_io/inode_pool.h2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_handle.cc1
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_handle.h2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_object.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_node_dir.h3
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_node_http.cc14
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_node_http.h4
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_passthrough.cc5
-rw-r--r--native_client_sdk/src/libraries/nacl_io_test/example.dsc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io_test/kernel_object_test.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io_test/kernel_wrap_test.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc1
-rw-r--r--native_client_sdk/src/libraries/nacl_io_test/mount_node_mock.h6
-rw-r--r--native_client_sdk/src/libraries/ppapi_simple/ps_instance.cc2
-rw-r--r--native_client_sdk/src/libraries/xray/library.dsc2
-rw-r--r--native_client_sdk/src/tools/host_gcc.mk8
29 files changed, 65 insertions, 60 deletions
diff --git a/native_client_sdk/src/build_tools/generate_make.py b/native_client_sdk/src/build_tools/generate_make.py
index faad723..e74891b 100644
--- a/native_client_sdk/src/build_tools/generate_make.py
+++ b/native_client_sdk/src/build_tools/generate_make.py
@@ -199,6 +199,10 @@ def ProcessProject(pepperdir, srcroot, dstroot, desc, toolchains, configs=None,
tools = [tool for tool in toolchains if tool in desc['TOOLS']]
if first_toolchain:
tools = [tools[0]]
+ for target in desc['TARGETS']:
+ target.setdefault('CXXFLAGS', [])
+ target['CXXFLAGS'].insert(0, '-Wall')
+
template_dict = {
'rel_sdk': '/'.join(['..'] * (len(desc['DEST'].split('/')) + 1)),
'pre': desc.get('PRE', ''),
diff --git a/native_client_sdk/src/build_tools/library.mk b/native_client_sdk/src/build_tools/library.mk
index 0dbf368..ff991aa 100644
--- a/native_client_sdk/src/build_tools/library.mk
+++ b/native_client_sdk/src/build_tools/library.mk
@@ -36,9 +36,14 @@ EXTRA_INC_PATHS={{' '.join(target['INCLUDES'])}}
include $(NACL_SDK_ROOT)/tools/common.mk
TARGET = {{target['NAME']}}
-[[flags = target.get('CCFLAGS', [])]]
+[[flags = target.get('CFLAGS', [])]]
[[flags.extend(target.get('CXXFLAGS', []))]]
[[ExpandDict('CFLAGS', flags)]]
+[[if 'CFLAGS_GCC' in target:]]
+ifneq ($(TOOLCHAIN),pnacl)
+CFLAGS += {{' '.join(target['CFLAGS_GCC'])}}
+endif
+[[]]
SOURCES = \
[[for source in sorted(target['SOURCES']):]]
@@ -57,3 +62,4 @@ ifeq ($(TOOLCHAIN),glibc)
$(eval $(call SO_RULE,$(TARGET),$(SOURCES)))
endif
[[]]
+{{post}}
diff --git a/native_client_sdk/src/build_tools/parse_dsc.py b/native_client_sdk/src/build_tools/parse_dsc.py
index 1fe8cbb..48c3761 100755
--- a/native_client_sdk/src/build_tools/parse_dsc.py
+++ b/native_client_sdk/src/build_tools/parse_dsc.py
@@ -28,7 +28,8 @@ DSC_FORMAT = {
'TYPE': (str, ['main', 'lib', 'static-lib', 'so', 'so-standalone'],
True),
'SOURCES': (list, '', True),
- 'CCFLAGS': (list, '', False),
+ 'CFLAGS': (list, '', False),
+ 'CFLAGS_GCC': (list, '', False),
'CXXFLAGS': (list, '', False),
'DEFINES': (list, '', False),
'LDFLAGS': (list, '', False),
diff --git a/native_client_sdk/src/build_tools/template.mk b/native_client_sdk/src/build_tools/template.mk
index 8d02495..8c63756 100644
--- a/native_client_sdk/src/build_tools/template.mk
+++ b/native_client_sdk/src/build_tools/template.mk
@@ -41,15 +41,19 @@ TARGET = {{targets[0]['NAME']}}
[[ source_list = ' \\\n '.join(source_list)]]
[[ sources = target['NAME'] + '_SOURCES']]
[[ cflags = target['NAME'] + '_CFLAGS']]
-[[ flags = target.get('CCFLAGS', [])]]
+[[ flags = target.get('CFLAGS', [])]]
[[ flags.extend(target.get('CXXFLAGS', []))]]
[[ if len(targets) == 1:]]
[[ sources = 'SOURCES']]
[[ cflags = 'CFLAGS']]
[[ ]]
[[ ExpandDict(cflags, flags)]]
+[[ if 'CFLAGS_GCC' in target:]]
+ifneq ($(TOOLCHAIN),pnacl)
+{{cflags}} += {{' '.join(target['CFLAGS_GCC'])}}
+endif
+[[ ]]
{{sources}} = {{source_list}}
-[[]]
# Build rules generated by macros from common.mk:
diff --git a/native_client_sdk/src/examples/demo/drive/drive.cc b/native_client_sdk/src/examples/demo/drive/drive.cc
index 20449eb..6632ad02 100644
--- a/native_client_sdk/src/examples/demo/drive/drive.cc
+++ b/native_client_sdk/src/examples/demo/drive/drive.cc
@@ -135,7 +135,7 @@ int32_t ReadUrl(pp::Instance* instance,
url_request.SetRecordDownloadProgress(false);
- const size_t kReadBufferSize = 16 * 1024;
+ const int32_t kReadBufferSize = 16 * 1024;
uint8_t* buffer_ = new uint8_t[kReadBufferSize];
do {
@@ -257,7 +257,6 @@ int32_t InsertFile(pp::Instance* instance,
Json::Value* root) {
static const char base_url[] =
"https://www.googleapis.com/upload/drive/v2/files";
- const char* method = "POST";
ReadUrlParams p;
p.url = base_url;
@@ -335,8 +334,8 @@ class Instance : public pp::Instance {
Instance::Instance(PP_Instance instance)
: pp::Instance(instance),
- callback_factory_(this),
worker_thread_(this),
+ callback_factory_(this),
is_processing_request_(false) {}
bool Instance::Init(uint32_t /*argc*/,
diff --git a/native_client_sdk/src/examples/demo/nacl_io/handlers.c b/native_client_sdk/src/examples/demo/nacl_io/handlers.c
index 2763e03..9182676 100644
--- a/native_client_sdk/src/examples/demo/nacl_io/handlers.c
+++ b/native_client_sdk/src/examples/demo/nacl_io/handlers.c
@@ -120,15 +120,6 @@ static void RemoveFileFromMap(int i) {
}
/**
- * Get a file handle from the g_OpenFiles map.
- * @param[in] i The index of the file handle to get.
- * @return the FILE*, or NULL of there is no open file with that handle.
- */
-static FILE* GetFileFromMap(int i) {
- return (FILE*)GetFromMap((void**)g_OpenFiles, MAX_OPEN_FILES, i);
-}
-
-/**
* Get a file, given a string containing the index.
* @param[in] s The string containing the file index.
* @param[out] file_index The index of this file.
@@ -156,14 +147,6 @@ static int AddDirToMap(DIR* dir) {
static void RemoveDirFromMap(int i) {
RemoveFromMap((void**)g_OpenDirs, MAX_OPEN_DIRS, i);
}
-/**
- * Get a dir handle from the g_OpenDirs map.
- * @param[in] i The index of the dir handle to get.
- * @return the DIR*, or NULL of there is no open dir with that handle.
- */
-static DIR* GetDirFromMap(int i) {
- return (DIR*)GetFromMap((void**)g_OpenDirs, MAX_OPEN_DIRS, i);
-}
/**
* Get a dir, given a string containing the index.
@@ -450,10 +433,7 @@ int HandleFclose(int num_params, char** params, char** output) {
* @param[out] output A string to write informational function output to.
* @return An errorcode; 0 means success, anything else is a failure. */
int HandleStat(int num_params, char** params, char** output) {
- FILE* file;
- int file_index;
const char* filename;
- const char* mode;
int result;
struct stat buf;
diff --git a/native_client_sdk/src/examples/tutorial/debugging/example.dsc b/native_client_sdk/src/examples/tutorial/debugging/example.dsc
index 607ec32..36ef726 100644
--- a/native_client_sdk/src/examples/tutorial/debugging/example.dsc
+++ b/native_client_sdk/src/examples/tutorial/debugging/example.dsc
@@ -12,7 +12,7 @@
'SOURCES' : [
'debugging.c',
],
- 'CCFLAGS': ['-fno-omit-frame-pointer'],
+ 'CFLAGS': ['-fno-omit-frame-pointer'],
'DEPS' : ['error_handling'],
'LIBS' : ['ppapi', 'pthread']
}
diff --git a/native_client_sdk/src/examples/tutorial/testing/example.dsc b/native_client_sdk/src/examples/tutorial/testing/example.dsc
index 2bf847e..13740f1 100644
--- a/native_client_sdk/src/examples/tutorial/testing/example.dsc
+++ b/native_client_sdk/src/examples/tutorial/testing/example.dsc
@@ -6,7 +6,9 @@
'NAME' : 'testing',
'TYPE' : 'main',
'SOURCES' : ['testing.cc'],
- 'LIBS' : ['ppapi_simple', 'nacl_io', 'ppapi_cpp', 'ppapi', 'gtest', 'pthread']
+ 'LIBS' : ['ppapi_simple', 'nacl_io', 'ppapi_cpp', 'ppapi', 'gtest', 'pthread'],
+ 'CXXFLAGS': ['-Wno-sign-compare', '-Wno-unused-private-field'],
+ 'CFLAGS_GCC': ['-Wno-unused-local-typedefs'],
}
],
'DATA': [
diff --git a/native_client_sdk/src/libraries/gmock/library.dsc b/native_client_sdk/src/libraries/gmock/library.dsc
index d3fb553..4cbbb85 100644
--- a/native_client_sdk/src/libraries/gmock/library.dsc
+++ b/native_client_sdk/src/libraries/gmock/library.dsc
@@ -19,6 +19,7 @@
],
# gmock-spec-builders.cc:248: error: enumeration value ‘FAIL’ not handled in switch
'CXXFLAGS': ['-Wno-switch-enum'],
+ 'CFLAGS_GCC': ['-Wno-unused-local-typedefs']
}
],
'HEADERS': [
diff --git a/native_client_sdk/src/libraries/gtest/library.dsc b/native_client_sdk/src/libraries/gtest/library.dsc
index 83b5f36..310feb1 100644
--- a/native_client_sdk/src/libraries/gtest/library.dsc
+++ b/native_client_sdk/src/libraries/gtest/library.dsc
@@ -23,8 +23,11 @@
],
# Ignore warnings:
# gtest.cc:2555: error: enumeration value ‘COLOR_DEFAULT’ not handled in switch
- # gtest-typed-test.h:239:47: error: anonymous variadic macros were introduced in C99 [-Werror=variadic-macros]
- 'CXXFLAGS': ['-Wno-switch-enum', '-Wno-variadic-macros'],
+ # gtest-typed-test.h:239:47: error: anonymous variadic macros were introduced in C99
+ # gtest-internal-inl.h:213:8: error: private field 'pretty_' is not used
+ 'CXXFLAGS': ['-Wno-switch-enum', '-Wno-variadic-macros', '-Wno-unused-private-field'],
+ 'CFLAGS_GCC': ['-Wno-unused-local-typedefs'],
+
'INCLUDES': [
# See comment below about gtest-internal-inl.h
'$(NACL_SDK_ROOT)/include/gtest/internal',
diff --git a/native_client_sdk/src/libraries/jsoncpp/library.dsc b/native_client_sdk/src/libraries/jsoncpp/library.dsc
index 44401fd..9ccc237 100644
--- a/native_client_sdk/src/libraries/jsoncpp/library.dsc
+++ b/native_client_sdk/src/libraries/jsoncpp/library.dsc
@@ -17,6 +17,7 @@
'json_value.cpp',
'json_writer.cpp',
],
+ 'CXXFLAGS': ['-Wno-strict-aliasing']
}
],
'HEADERS': [
diff --git a/native_client_sdk/src/libraries/nacl_io/inode_pool.h b/native_client_sdk/src/libraries/nacl_io/inode_pool.h
index 8ab25b2..00dfb58 100644
--- a/native_client_sdk/src/libraries/nacl_io/inode_pool.h
+++ b/native_client_sdk/src/libraries/nacl_io/inode_pool.h
@@ -17,7 +17,7 @@ namespace nacl_io {
class INodePool {
public:
- INodePool() : max_nodes_(0), num_nodes_(0) {}
+ INodePool() : num_nodes_(0), max_nodes_(0) {}
ino_t Acquire() {
AUTO_LOCK(lock_);
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc b/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc
index 75b5216..19e4514 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc
@@ -31,7 +31,6 @@ KernelHandle::~KernelHandle() {
Error KernelHandle::Init(int open_mode) {
if (open_mode & O_APPEND) {
- size_t node_size;
Error error = node_->GetSize(&offs_);
if (error)
return error;
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_handle.h b/native_client_sdk/src/libraries/nacl_io/kernel_handle.h
index cf1c06fb..656f1d3 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_handle.h
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_handle.h
@@ -42,8 +42,8 @@ class KernelHandle : public sdk_util::RefObject {
const ScopedMount& mount() { return mount_; }
private:
- ScopedMountNode node_;
ScopedMount mount_;
+ ScopedMountNode node_;
sdk_util::SimpleLock offs_lock_;
size_t offs_;
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_object.cc b/native_client_sdk/src/libraries/nacl_io/kernel_object.cc
index 44b90a5..b8e9a8f 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_object.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_object.cc
@@ -183,7 +183,7 @@ void KernelObject::FreeAndReassignFD(int fd, const ScopedKernelHandle& handle) {
AUTO_LOCK(handle_lock_);
// If the required FD is larger than the current set, grow the set
- if (fd >= handle_map_.size())
+ if (fd >= (int)handle_map_.size())
handle_map_.resize(fd + 1);
handle_map_[fd] = handle;
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc
index 2de85f8..1cc7e33 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc
@@ -264,7 +264,7 @@ int mount(const char* source, const char* target, const char* filesystemtype,
int WRAP(munmap)(void* addr, size_t length) {
// Always let the real munmap run on the address range. It is not an error if
// there are no mapped pages in that range.
- int result = ki_munmap(addr, length);
+ ki_munmap(addr, length);
return REAL(munmap)(addr, length);
}
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc b/native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc
index 5f06b5a..3bb69b5 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc
@@ -33,7 +33,7 @@ Error MountNodeDir::Read(size_t offs, void* buf, size_t count, int* out_bytes) {
Error MountNodeDir::FTruncate(off_t size) { return EISDIR; }
Error MountNodeDir::Write(size_t offs,
- void* buf,
+ const void* buf,
size_t count,
int* out_bytes) {
*out_bytes = 0;
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node_dir.h b/native_client_sdk/src/libraries/nacl_io/mount_node_dir.h
index e418a9c..2b4c237 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_node_dir.h
+++ b/native_client_sdk/src/libraries/nacl_io/mount_node_dir.h
@@ -34,7 +34,8 @@ class MountNodeDir : public MountNode {
size_t count,
int* out_bytes);
virtual Error Read(size_t offs, void *buf, size_t count, int* out_bytes);
- virtual Error Write(size_t offs, void *buf, size_t count, int* out_bytes);
+ virtual Error Write(size_t offs, const void *buf,
+ size_t count, int* out_bytes);
// Adds a finds or adds a directory entry as an INO, updating the refcount
virtual Error AddChild(const std::string& name, const ScopedMountNode& node);
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node_http.cc b/native_client_sdk/src/libraries/nacl_io/mount_node_http.cc
index 988091e..56396be 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_node_http.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_node_http.cc
@@ -377,8 +377,8 @@ Error MountNodeHttp::DownloadToCache() {
// We don't know how big the file is. Read in chunks.
cached_data_.resize(MAX_READ_BUFFER_SIZE);
- size_t total_bytes_read = 0;
- size_t bytes_to_read = MAX_READ_BUFFER_SIZE;
+ int total_bytes_read = 0;
+ int bytes_to_read = MAX_READ_BUFFER_SIZE;
while (true) {
char* buf = cached_data_.data() + total_bytes_read;
int bytes_read;
@@ -400,14 +400,14 @@ Error MountNodeHttp::DownloadToCache() {
Error MountNodeHttp::ReadPartialFromCache(size_t offs,
void* buf,
- size_t count,
+ int count,
int* out_bytes) {
*out_bytes = 0;
if (offs > cached_data_.size())
return EINVAL;
- count = std::min(count, cached_data_.size() - offs);
+ count = std::min(count, static_cast<int>(cached_data_.size() - offs));
memcpy(buf, &cached_data_.data()[offs], count);
*out_bytes = count;
@@ -509,7 +509,7 @@ Error MountNodeHttp::DownloadPartial(size_t offs,
Error MountNodeHttp::DownloadToBuffer(PP_Resource loader,
void* buf,
- size_t count,
+ int count,
int* out_bytes) {
*out_bytes = 0;
@@ -517,9 +517,9 @@ Error MountNodeHttp::DownloadToBuffer(PP_Resource loader,
URLLoaderInterface* loader_interface = ppapi->GetURLLoaderInterface();
char* out_buffer = static_cast<char*>(buf);
- size_t bytes_to_read = count;
+ int bytes_to_read = count;
while (bytes_to_read > 0) {
- int32_t bytes_read = loader_interface->ReadResponseBody(
+ int bytes_read = loader_interface->ReadResponseBody(
loader, out_buffer, bytes_to_read, PP_BlockUntilComplete());
if (bytes_read == 0) {
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node_http.h b/native_client_sdk/src/libraries/nacl_io/mount_node_http.h
index 56d71f8..aa953f3 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_node_http.h
+++ b/native_client_sdk/src/libraries/nacl_io/mount_node_http.h
@@ -51,12 +51,12 @@ class MountNodeHttp : public MountNode {
Error DownloadToCache();
Error ReadPartialFromCache(size_t offs,
void* buf,
- size_t count,
+ int count,
int* out_bytes);
Error DownloadPartial(size_t offs, void* buf, size_t count, int* out_bytes);
Error DownloadToBuffer(PP_Resource loader,
void* buf,
- size_t count,
+ int count,
int* out_bytes);
std::string url_;
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_passthrough.cc b/native_client_sdk/src/libraries/nacl_io/mount_passthrough.cc
index 5ba4975..179ad8f 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_passthrough.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_passthrough.cc
@@ -66,7 +66,10 @@ class MountNodePassthrough : public MountNode {
return ENOSYS;
}
- virtual Error GetDents(size_t offs, struct dirent* pdir, size_t count) {
+ virtual Error GetDents(size_t offs,
+ struct dirent* pdir,
+ size_t count,
+ int* out_bytes) {
size_t nread;
int err = _real_getdents(real_fd_, pdir, count, &nread);
if (err)
diff --git a/native_client_sdk/src/libraries/nacl_io_test/example.dsc b/native_client_sdk/src/libraries/nacl_io_test/example.dsc
index 934b25b..c4e9f69 100644
--- a/native_client_sdk/src/libraries/nacl_io_test/example.dsc
+++ b/native_client_sdk/src/libraries/nacl_io_test/example.dsc
@@ -33,6 +33,8 @@
# referenced before ppapi.
'LIBS': ['gmock', 'ppapi_cpp', 'ppapi', 'gtest', 'pthread'],
'INCLUDES': ['$(NACL_SDK_ROOT)/include/gtest/internal'],
+ 'CXXFLAGS': ['-Wno-sign-compare', '-Wno-unused-private-field'],
+ 'CFLAGS_GCC': ['-Wno-unused-local-typedefs'],
}
],
'DATA': [
diff --git a/native_client_sdk/src/libraries/nacl_io_test/kernel_object_test.cc b/native_client_sdk/src/libraries/nacl_io_test/kernel_object_test.cc
index 4ce54aa..35926d1 100644
--- a/native_client_sdk/src/libraries/nacl_io_test/kernel_object_test.cc
+++ b/native_client_sdk/src/libraries/nacl_io_test/kernel_object_test.cc
@@ -173,7 +173,7 @@ TEST_F(KernelObjectTest, FreeAndReassignFD) {
EXPECT_EQ(2, node->RefCount());
EXPECT_EQ(1, raw_handle->RefCount());
- int fd1 = proxy->AllocateFD(handle);
+ proxy->AllocateFD(handle);
EXPECT_EQ(2, mnt->RefCount());
EXPECT_EQ(2, node->RefCount());
EXPECT_EQ(2, raw_handle->RefCount());
diff --git a/native_client_sdk/src/libraries/nacl_io_test/kernel_wrap_test.cc b/native_client_sdk/src/libraries/nacl_io_test/kernel_wrap_test.cc
index ae7a5f8..1193e6f 100644
--- a/native_client_sdk/src/libraries/nacl_io_test/kernel_wrap_test.cc
+++ b/native_client_sdk/src/libraries/nacl_io_test/kernel_wrap_test.cc
@@ -275,7 +275,7 @@ TEST_F(KernelWrapTest, unlink) {
}
TEST_F(KernelWrapTest, utime) {
- const struct utimbuf* times;
+ const struct utimbuf* times = NULL;
EXPECT_CALL(mock, utime(StrEq("utime"), times));
utime("utime", times);
}
diff --git a/native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc b/native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc
index cf7dd71..13153a2 100644
--- a/native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc
+++ b/native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc
@@ -295,7 +295,6 @@ void MountHttpNodeTest::SetResponseExpectFail(int status_code,
ON_CALL(*response_, GetProperty(response_resource_, _))
.WillByDefault(Return(PP_MakeUndefined()));
- PP_Var var_headers = MakeString(348);
EXPECT_CALL(*response_,
GetProperty(response_resource_,
PP_URLRESPONSEPROPERTY_STATUSCODE))
diff --git a/native_client_sdk/src/libraries/nacl_io_test/mount_node_mock.h b/native_client_sdk/src/libraries/nacl_io_test/mount_node_mock.h
index 7ca5043..fa407a4 100644
--- a/native_client_sdk/src/libraries/nacl_io_test/mount_node_mock.h
+++ b/native_client_sdk/src/libraries/nacl_io_test/mount_node_mock.h
@@ -22,11 +22,11 @@ class MountNodeMock : public nacl_io::MountNode {
MOCK_METHOD0(Destroy, void());
MOCK_METHOD0(FSync, Error());
MOCK_METHOD1(FTruncate, Error(off_t));
- MOCK_METHOD4(GetDents, Error(size_t, struct dirent*, size_t, int*));
+ MOCK_METHOD4(GetDents, Error(size_t, struct dirent*, size_t, size_t*));
MOCK_METHOD1(GetStat, Error(struct stat*));
MOCK_METHOD2(Ioctl, Error(int, char*));
- MOCK_METHOD4(Read, Error(size_t, void*, size_t, int*));
- MOCK_METHOD4(Write, Error(size_t, const void*, size_t, int*));
+ MOCK_METHOD4(Read, Error(size_t, void*, size_t, size_t*));
+ MOCK_METHOD4(Write, Error(size_t, const void*, size_t, size_t*));
MOCK_METHOD6(MMap, Error(void*, size_t, int, int, size_t, void**));
MOCK_METHOD0(GetLinks, int());
MOCK_METHOD0(GetMode, int());
diff --git a/native_client_sdk/src/libraries/ppapi_simple/ps_instance.cc b/native_client_sdk/src/libraries/ppapi_simple/ps_instance.cc
index fb92ca5..741697c 100644
--- a/native_client_sdk/src/libraries/ppapi_simple/ps_instance.cc
+++ b/native_client_sdk/src/libraries/ppapi_simple/ps_instance.cc
@@ -93,8 +93,8 @@ PSInstance::PSInstance(PP_Instance instance, const char *argv[])
pp::MouseLock(this),
pp::Graphics3DClient(this),
main_loop_(NULL),
- verbosity_(PSV_WARN),
events_enabled_(PSE_NONE),
+ verbosity_(PSV_WARN),
fd_tty_(-1) {
// Set the single Instance object
s_InstanceObject = this;
diff --git a/native_client_sdk/src/libraries/xray/library.dsc b/native_client_sdk/src/libraries/xray/library.dsc
index ed245e2..f7e23ef 100644
--- a/native_client_sdk/src/libraries/xray/library.dsc
+++ b/native_client_sdk/src/libraries/xray/library.dsc
@@ -17,7 +17,7 @@
'symtable.c',
'xray.c'
],
- 'CCFLAGS': [
+ 'CFLAGS': [
'-DXRAY -DXRAY_ANNOTATE -O2'
]
}
diff --git a/native_client_sdk/src/tools/host_gcc.mk b/native_client_sdk/src/tools/host_gcc.mk
index e13d1af..67f273b 100644
--- a/native_client_sdk/src/tools/host_gcc.mk
+++ b/native_client_sdk/src/tools/host_gcc.mk
@@ -27,8 +27,8 @@ $(error Unable to find gcc in PATH while building Host build)
endif
-LINUX_WARNINGS ?= -Wno-long-long
-LINUX_CCFLAGS = -fPIC -pthread $(LINUX_WARNINGS) -I$(NACL_SDK_ROOT)/include -I$(NACL_SDK_ROOT)/include/linux
+LINUX_WARNINGS ?= -Wno-long-long -Wall -Werror
+LINUX_CFLAGS = -fPIC -pthread $(LINUX_WARNINGS) -I$(NACL_SDK_ROOT)/include -I$(NACL_SDK_ROOT)/include/linux
#
@@ -40,14 +40,14 @@ LINUX_CCFLAGS = -fPIC -pthread $(LINUX_WARNINGS) -I$(NACL_SDK_ROOT)/include -I$(
define C_COMPILER_RULE
-include $(call SRC_TO_DEP,$(1))
$(call SRC_TO_OBJ,$(1)): $(1) $(TOP_MAKE) | $(dir $(call SRC_TO_OBJ,$(1)))dir.stamp
- $(call LOG,CC ,$$@,$(HOST_CC) -o $$@ -c $$< -fPIC $(POSIX_FLAGS) $(2) $(LINUX_FLAGS))
+ $(call LOG,CC ,$$@,$(HOST_CC) -o $$@ -c $$< -fPIC $(POSIX_FLAGS) $(2) $(LINUX_CFLAGS))
@$(FIXDEPS) $(call SRC_TO_DEP_PRE_FIXUP,$(1))
endef
define CXX_COMPILER_RULE
-include $(call SRC_TO_DEP,$(1))
$(call SRC_TO_OBJ,$(1)): $(1) $(TOP_MAKE) | $(dir $(call SRC_TO_OBJ,$(1)))dir.stamp
- $(call LOG,CXX ,$$@,$(HOST_CXX) -o $$@ -c $$< -fPIC $(POSIX_FLAGS) $(2) $(LINUX_FLAGS))
+ $(call LOG,CXX ,$$@,$(HOST_CXX) -o $$@ -c $$< -fPIC $(POSIX_FLAGS) $(2) $(LINUX_CFLAGS))
@$(FIXDEPS) $(call SRC_TO_DEP_PRE_FIXUP,$(1))
endef