#6 Tiny bug prevents compilation on OpenBSD

closed-accepted
5
2006-07-09
2006-07-08
No

It wipes out on OpenBSD 3.9:
gcc -DHAVE_CONFIG_H -I. -I. -I../../../../include
-I/usr/X11R6/include -I/usr/local/include
-I../../../../include -pipe -fno-strict-aliasing
-fno-common -g -c rletorla.c
rletorla.c: In function `write_rlb_header':
rletorla.c:182: error: conflicting types for `time'
/usr/include/time.h:114: error: previous declaration of
`time'
rletorla.c:182: warning: extern declaration of `time'
doesn't match global one
rletorla.c:219: warning: passing arg 1 of `ctime' from
incompatible pointer type
gmake[5]: *** [rletorla.o] Error 1

The following patch fixes it.

--- rletorla_old.c Mon Apr 17 16:17:45 2006
+++ rletorla.c Sat Jul 8 18:30:59 2006
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
+#include <time.h>
#include "rlb_header.h"
#include "rle.h"

@@ -179,7 +180,6 @@
char *ctime();
char *d_str;
long second;
- long time();

bzero(&rlb_head, 740);
rlb_head.window.left = minx;
@@ -215,7 +215,7 @@
gethostname(rlb_head.machine, 32);
#endif
strcpy(rlb_head.user, getenv("USER"));
- second = time((long *)NULL);
+ second = time(NULL);
d_str = ctime(&second);
strncpy(rlb_head.date, &d_str[4], 12);
strncpy(&rlb_head.date[12], &d_str[19], 5);

Discussion

  • Sean Morrison

    Sean Morrison - 2006-07-09

    Logged In: YES
    user_id=785737

    Submission moved to patches.

     
  • Sean Morrison

    Sean Morrison - 2006-07-09
    • labels: 622299 --> Compilation
    • milestone: 387264 -->
    • assigned_to: nobody --> brlcad
     
  • Sean Morrison

    Sean Morrison - 2006-07-09

    Logged In: YES
    user_id=785737

    Applied to CVS, thx!

     
  • Sean Morrison

    Sean Morrison - 2006-07-09
    • status: open --> closed-accepted
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks