Skip to content

Commit

Permalink
Remove global -Wno-return-type from CMakeLists.txt (#9387)
Browse files Browse the repository at this point in the history
Summary:
This PR makes a change to remove the globally applied `-Wno-return-type`, fixes some violations. This PR originally #4618 disabled it. In the case of a code bug, it may become difficult to diagnose the actual cause. An example of this is

```
#include <stdio.h>

bool test1()
{
    printf("Called inner\n");
}
void test()
{
    test1();
}

int main(int argc, char* argv[])
{
    printf("Called test\n");
    test();
    printf("Finished test\n");
    return 0;
}
```
which crashes when compiled with -O2 due to bad codegen.

Pull Request resolved: #9387

Reviewed By: pedroerp

Differential Revision: D55933467

Pulled By: mbasmanova

fbshipit-source-id: da748fc5df19adb3d6e295973cc12e75ac43f2c1
  • Loading branch information
acvictor authored and facebook-github-bot committed Apr 10, 2024
1 parent c4cd265 commit 22279f9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@ if("${ENABLE_ALL_WARNINGS}")
-Wno-strict-aliasing \
-Wno-type-limits \
-Wno-stringop-overflow \
-Wno-stringop-overread \
-Wno-return-type")
-Wno-stringop-overread")
endif()

set(KNOWN_WARNINGS
Expand Down
1 change: 1 addition & 0 deletions velox/connectors/hive/HivePartitionFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ inline uint32_t hashOne(
VELOX_UNSUPPORTED(
"Hive partitioning function doesn't support {} type",
TypeTraits<kind>::name);
return 0; // Make compiler happy.
}

template <>
Expand Down
5 changes: 2 additions & 3 deletions velox/connectors/hive/storage_adapters/abfs/AbfsWriteFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,10 @@ class AbfsWriteFile::Impl {
blobStorageFileClient_->getProperties();
return true;
} catch (Azure::Storage::StorageException& e) {
if (e.StatusCode == Azure::Core::Http::HttpStatusCode::NotFound) {
return false;
} else {
if (e.StatusCode != Azure::Core::Http::HttpStatusCode::NotFound) {
throwStorageExceptionWithOperationDetails("GetProperties", path_, e);
}
return false;
}
}

Expand Down
1 change: 1 addition & 0 deletions velox/exec/tests/TableWriteTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ std::string testModeString(TestMode mode) {
case TestMode::kBucketed:
return "BUCKETED";
}
VELOX_UNREACHABLE();
}

static std::shared_ptr<core::AggregationNode> generateAggregationNode(
Expand Down
1 change: 1 addition & 0 deletions velox/functions/prestosql/types/JsonType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ struct CastFromJsonTypedImpl {
static simdjson::error_code apply(Input, exec::GenericWriter&) {
VELOX_NYI(
"Casting from JSON to {} is not supported.", TypeTraits<kind>::name);
return simdjson::error_code::UNEXPECTED_ERROR; // Make compiler happy.
}
};

Expand Down
2 changes: 1 addition & 1 deletion velox/functions/remote/if/GetSerde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ std::unique_ptr<VectorSerde> getSerde(const remote::PageFormat& format) {
case remote::PageFormat::SPARK_UNSAFE_ROW:
return std::make_unique<serializer::spark::UnsafeRowVectorSerde>();
}
VELOX_UNREACHABLE();
}

} // namespace facebook::velox::functions

0 comments on commit 22279f9

Please sign in to comment.