Commit 28f98329 by Ramsay Jones Committed by Andreas Ericsson

Fix inconsistent definition of off_t on Linux

In order to avoid inconsistent definitions of type off_t, all
compilation units should include the "common.h" header file
before certain system headers (those which directly or indirectly
lead to the definition of off_t). The "common.h" header contains
the definition of _FILE_OFFSET_BITS to select 64-bit file offsets.

The symptom of this inconsistency, while compiling with -Wextra, is
the following warning:

    In file included from src/common.h:50,
                     from src/commit.c:28:
    src/util.h: In function git__is_sizet:
    src/util.h:41: warning: comparison between signed and unsigned

In order to fix the problem, we simply remove the #include <time.h>
statement at the head of src/commit.c.  Note that src/commit.h also
includes <time.h>.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Andreas Ericsson <ae@op5.se>
parent c1b62b2e
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#include <time.h>
#include "common.h" #include "common.h"
#include "commit.h" #include "commit.h"
#include "revwalk.h" #include "revwalk.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment