sebastian schneider
14.11.01, 12:00
Hallo,
ich versuche gerade auf einem neueren System die daemontools zu kompilieren (, mit denen ich eigentlich noch nie Schwierigkeiten hatte ), jedoch bricht der Compiler mit einer Fehlermeldung ab:
....
./compile tai64n.c
./load tai64n time.a unix.a byte.a
./compile tai64nlocal.c
tai64nlocal.c: In function `main':
tai64nlocal.c:54: warning: assignment makes pointer from integer without a cast
tai64nlocal.c:55: dereferencing pointer to incomplete type
tai64nlocal.c:56: dereferencing pointer to incomplete type
tai64nlocal.c:57: dereferencing pointer to incomplete type
tai64nlocal.c:58: dereferencing pointer to incomplete type
tai64nlocal.c:59: dereferencing pointer to incomplete type
tai64nlocal.c:60: dereferencing pointer to incomplete type
make: *** [tai64nlocal.o] Error 1
Hier die c.Datei:
#include <sys/types.h>
#include <sys/time.h>
#include "buffer.h"
#include "exit.h"
#include "fmt.h"
char num[FMT_ULONG];
void get(char *ch)
{
int r;
r = buffer_GETC(buffer_0,ch);
if (r == 1) return;
if (r == 0) _exit(0);
_exit(111);
}
void out(char *buf,int len)
{
if (buffer_put(buffer_1,buf,len) == -1)
_exit(111);
}
time_t secs;
unsigned long nanosecs;
unsigned long u;
struct tm *t;
main()
{
char ch;
for (;;) {
get(&ch);
if (ch == '@') {
secs = 0;
nanosecs = 0;
for (;;) {
get(&ch);
u = ch - '0';
if (u >= 10) {
u = ch - 'a';
if (u >= 6) break;
u += 10;
}
secs <<= 4;
secs += nanosecs >> 28;
nanosecs &= 0xfffffff;
nanosecs <<= 4;
nanosecs += u;
}
secs -= 4611686018427387914ULL;
t = localtime(&secs);
out(num,fmt_ulong(num,1900 + t->tm_year));
out("-",1); out(num,fmt_uint0(num,1 + t->tm_mon,2));
out("-",1); out(num,fmt_uint0(num,t->tm_mday,2));
out(" ",1); out(num,fmt_uint0(num,t->tm_hour,2));
out(":",1); out(num,fmt_uint0(num,t->tm_min,2));
out(":",1); out(num,fmt_uint0(num,t->tm_sec,2));
out(".",1); out(num,fmt_uint0(num,nanosecs,9));
}
for (;;) {
out(&ch,1);
if (ch == '\n') break;
get(&ch);
}
}
}
EOF
Das betreffende System:
i686
SuSE 7.2
kernel 2.4.4.SuSE
gcc 2.95.3
glibc 2.2.2
make 3.79.1
Hat jemand eine Idee?
mfg
Basti
ich versuche gerade auf einem neueren System die daemontools zu kompilieren (, mit denen ich eigentlich noch nie Schwierigkeiten hatte ), jedoch bricht der Compiler mit einer Fehlermeldung ab:
....
./compile tai64n.c
./load tai64n time.a unix.a byte.a
./compile tai64nlocal.c
tai64nlocal.c: In function `main':
tai64nlocal.c:54: warning: assignment makes pointer from integer without a cast
tai64nlocal.c:55: dereferencing pointer to incomplete type
tai64nlocal.c:56: dereferencing pointer to incomplete type
tai64nlocal.c:57: dereferencing pointer to incomplete type
tai64nlocal.c:58: dereferencing pointer to incomplete type
tai64nlocal.c:59: dereferencing pointer to incomplete type
tai64nlocal.c:60: dereferencing pointer to incomplete type
make: *** [tai64nlocal.o] Error 1
Hier die c.Datei:
#include <sys/types.h>
#include <sys/time.h>
#include "buffer.h"
#include "exit.h"
#include "fmt.h"
char num[FMT_ULONG];
void get(char *ch)
{
int r;
r = buffer_GETC(buffer_0,ch);
if (r == 1) return;
if (r == 0) _exit(0);
_exit(111);
}
void out(char *buf,int len)
{
if (buffer_put(buffer_1,buf,len) == -1)
_exit(111);
}
time_t secs;
unsigned long nanosecs;
unsigned long u;
struct tm *t;
main()
{
char ch;
for (;;) {
get(&ch);
if (ch == '@') {
secs = 0;
nanosecs = 0;
for (;;) {
get(&ch);
u = ch - '0';
if (u >= 10) {
u = ch - 'a';
if (u >= 6) break;
u += 10;
}
secs <<= 4;
secs += nanosecs >> 28;
nanosecs &= 0xfffffff;
nanosecs <<= 4;
nanosecs += u;
}
secs -= 4611686018427387914ULL;
t = localtime(&secs);
out(num,fmt_ulong(num,1900 + t->tm_year));
out("-",1); out(num,fmt_uint0(num,1 + t->tm_mon,2));
out("-",1); out(num,fmt_uint0(num,t->tm_mday,2));
out(" ",1); out(num,fmt_uint0(num,t->tm_hour,2));
out(":",1); out(num,fmt_uint0(num,t->tm_min,2));
out(":",1); out(num,fmt_uint0(num,t->tm_sec,2));
out(".",1); out(num,fmt_uint0(num,nanosecs,9));
}
for (;;) {
out(&ch,1);
if (ch == '\n') break;
get(&ch);
}
}
}
EOF
Das betreffende System:
i686
SuSE 7.2
kernel 2.4.4.SuSE
gcc 2.95.3
glibc 2.2.2
make 3.79.1
Hat jemand eine Idee?
mfg
Basti