Skip to content

Commit 4dd5405

Browse files
author
Daniel Kroening
authored
Merge pull request diffblue#1210 from reuk/stop-using-c-headers
Stop using C headers
2 parents 9d3a99e + 33811ce commit 4dd5405

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CODING_STANDARD.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ Here a few minimalistic coding rules for the CPROVER source tree.
107107
include in the source file. For example, given `foo.h` and `foo.cpp`, the
108108
line `#include "foo.h"` should precede all other include statements in
109109
`foo.cpp`.
110+
- Use the C++ versions of C headers (e.g. `cmath` instead of `math.h`).
111+
Some of the C headers use macros instead of functions which can have
112+
unexpected consequences.
110113
111114
# Makefiles
112115
- Each source file should appear on a separate line

src/util/ieee_float.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ Author: Daniel Kroening, [email protected]
88

99
#include "ieee_float.h"
1010

11-
// <cstdint> is yet to come
12-
#include <stdint.h>
13-
11+
#include <cstdint>
1412
#include <ostream>
1513
#include <cassert>
1614
#include <cmath>

src/util/pipe_stream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ Module: A stdin/stdout pipe as STL stream
2323
#else
2424
#include <sys/types.h>
2525
#include <sys/wait.h>
26-
#include <signal.h>
2726
#include <unistd.h>
2827
#include <cstring>
28+
#include <csignal>
2929
#endif
3030

3131
#define READ_BUFFER_SIZE 1024

0 commit comments

Comments
 (0)