Skip to content

Commit

Permalink
ARROW-6120: [C++] Forbid use of <iostream> in public header files
Browse files Browse the repository at this point in the history
I also noticed that `parquet/thrift.h` is an internal header that should not be installed.

Closes apache#5300 from wesm/ARROW-6120 and squashes the following commits:

472cfb5 <Wes McKinney> Forbid use of iostream in public headers

Authored-by: Wes McKinney <[email protected]>
Signed-off-by: Krisztián Szűcs <[email protected]>
  • Loading branch information
wesm authored and kszucs committed Sep 6, 2019
1 parent c0dbf71 commit 200e308
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 16 deletions.
1 change: 1 addition & 0 deletions cpp/build-support/lint_cpp_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def lint_file(path):
fail_rules = [
# rule, error message, rule-specific exclusions list
(lambda x: '<mutex>' in x, 'Uses <mutex>', []),
(lambda x: '<iostream>' in x, 'Uses <iostream>', []),
(lambda x: re.match(_NULLPTR_REGEX, x), 'Uses nullptr', []),
(lambda x: re.match(_RETURN_NOT_OK_REGEX, x),
'Use ARROW_RETURN_NOT_OK in header files', _paths('''\
Expand Down
1 change: 0 additions & 1 deletion cpp/src/gandiva/decimal_scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#pragma once

#include <cstdint>
#include <iostream>
#include <string>
#include "arrow/util/decimal.h"
#include "gandiva/basic_decimal_scalar.h"
Expand Down
6 changes: 1 addition & 5 deletions cpp/src/gandiva/in_holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
// specific language governing permissions and limitations
// under the License.

#ifndef GANDIVA_IN_HOLDER_H
#define GANDIVA_IN_HOLDER_H
#pragma once

#include <iostream>
#include <string>
#include <unordered_set>

Expand All @@ -45,5 +43,3 @@ class InHolder {
};

} // namespace gandiva

#endif // GANDIVA_IN_HOLDER_H
1 change: 1 addition & 0 deletions cpp/src/gandiva/tree_expr_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "gandiva/tree_expr_builder.h"

#include <iostream>
#include <utility>

#include "gandiva/decimal_type_util.h"
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/column_io_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "parquet/file_reader.h"
#include "parquet/metadata.h"
#include "parquet/platform.h"
#include "parquet/thrift.h"
#include "parquet/thrift_internal.h"

namespace parquet {

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/column_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "parquet/encoding.h"
#include "parquet/properties.h"
#include "parquet/statistics.h"
#include "parquet/thrift.h" // IWYU pragma: keep
#include "parquet/thrift_internal.h" // IWYU pragma: keep

using arrow::MemoryPool;
using arrow::internal::checked_cast;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/column_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "parquet/properties.h"
#include "parquet/schema.h"
#include "parquet/statistics.h"
#include "parquet/thrift.h"
#include "parquet/thrift_internal.h"
#include "parquet/types.h"

namespace parquet {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/column_writer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "parquet/properties.h"
#include "parquet/statistics.h"
#include "parquet/test_util.h"
#include "parquet/thrift.h"
#include "parquet/thrift_internal.h"
#include "parquet/types.h"

namespace parquet {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/file_deserialize_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "parquet/file_reader.h"
#include "parquet/platform.h"
#include "parquet/test_util.h"
#include "parquet/thrift.h"
#include "parquet/thrift_internal.h"
#include "parquet/types.h"

#include "arrow/io/memory.h"
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "parquet/schema.h"
#include "parquet/schema_internal.h"
#include "parquet/statistics.h"
#include "parquet/thrift.h"
#include "parquet/thrift_internal.h"

// ARROW-6096: The boost regex library must be used when compiling with gcc < 4.9
#if defined(PARQUET_USE_BOOST_REGEX)
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/metadata_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "parquet/schema.h"
#include "parquet/statistics.h"
#include "parquet/thrift.h"
#include "parquet/thrift_internal.h"
#include "parquet/types.h"

namespace parquet {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "parquet/exception.h"
#include "parquet/schema_internal.h"
#include "parquet/thrift.h"
#include "parquet/thrift_internal.h"

using parquet::format::SchemaElement;

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/schema_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "parquet/exception.h"
#include "parquet/schema.h"
#include "parquet/schema_internal.h"
#include "parquet/thrift.h"
#include "parquet/thrift_internal.h"
#include "parquet/types.h"

using ::arrow::internal::checked_cast;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/statistics_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "parquet/schema.h"
#include "parquet/statistics.h"
#include "parquet/test_util.h"
#include "parquet/thrift.h"
#include "parquet/thrift_internal.h"
#include "parquet/types.h"

using arrow::default_memory_pool;
Expand Down
File renamed without changes.

0 comments on commit 200e308

Please sign in to comment.