Progress.c uses implicitly declared time()

Ivan Skytte Jørgensen isj-nedit-dev at i1.dk
Sat Oct 13 11:02:02 CEST 2007


On Thursday 11 October 2007 22:39:00 Ivan Skytte Jørgensen wrote:
> Microline/XmL/Progress.c uses time() without including <time.h>
>
> This makes the compiler implicitly declare time() as returning and int, but
> it really returns a time_t. Depending on calling convention this may make
> the return valued garbed. It is undefined behaviour in C99.
>
> Patch attached. Please apply.

Now attached as .txt
-------------- next part --------------
diff -r -U3 nedit.isj2/Microline/XmL/Progress.c nedit.isj3/Microline/XmL/Progress.c
--- nedit.isj2/Microline/XmL/Progress.c 2004-07-21 22:38:46.000000000 +0200
+++ nedit.isj3/Microline/XmL/Progress.c 2007-10-08 23:40:17.000000000 +0200
@@ -49,6 +49,7 @@
 #include "ProgressP.h"
 #include <stdio.h>
 #include <sys/time.h>
+#include <time.h>
 
 static void ClassInitialize(void);
 static void Initialize(Widget , Widget, ArgList, Cardinal *);


More information about the Develop mailing list