]> Zhao Yanbai Git Server - minix.git/commitdiff
include, kernel: minor fixes to make compiling and linking work with clang.
authorBen Gras <ben@minix3.org>
Tue, 6 Jul 2010 11:59:19 +0000 (11:59 +0000)
committerBen Gras <ben@minix3.org>
Tue, 6 Jul 2010 11:59:19 +0000 (11:59 +0000)
(fixing warnings)

12 files changed:
include/minix/sysutil.h
include/time.h
kernel/Makefile
kernel/arch/i386/apic.c
kernel/arch/i386/arch_system.c
kernel/arch/i386/arch_watchdog.c
kernel/arch/i386/proto.h
kernel/proto.h
kernel/system.c
kernel/system/do_fork.c
kernel/system/do_getksig.c
kernel/system/do_privctl.c

index e596e9635d97fbad567565a23f2c6aa662946857..477ce5db64ad799b44ae1ab5beee83afb5cffea6 100644 (file)
@@ -44,7 +44,7 @@ _PROTOTYPE( int fkey_ctl, (int req, int *fkeys, int *sfkeys)          );
 
 _PROTOTYPE( int printf, (const char *fmt, ...));
 _PROTOTYPE( void kputc, (int c));
-_PROTOTYPE( void panic, (const char *fmt, ...));
+_PROTOTYPE( __dead void panic, (const char *fmt, ...));
 _PROTOTYPE( int getuptime, (clock_t *ticks));
 _PROTOTYPE( int getuptime2, (clock_t *ticks, time_t *boottime));
 _PROTOTYPE( int tickdelay, (clock_t ticks));
index 7dc7de4596d1b7e8ef7cbbfae5a853c6e198dd06..bf9ce68a3d3f9c176e2a74877e855dcf9de9802e 100644 (file)
@@ -66,8 +66,10 @@ _PROTOTYPE( struct tm *localtime_r, (const time_t *const timep,
                                        struct tm *tmp)                 );
 _PROTOTYPE( size_t strftime, (char *_s, size_t _max, const char *_fmt,
                                const struct tm *_timep)                );
-_PROTOTYPE(char *strptime, (const char *buf, const char *format,
+_PROTOTYPE( char *strptime, (const char *buf, const char *format,
                                struct tm *timeptr)                     );
+_PROTOTYPE( time_t timegm, (struct tm * const tmp)                     );
+
 
 #ifdef _POSIX_SOURCE
 _PROTOTYPE( void tzset, (void)                                         );
index 61a87376ce9402e7664a34023518c827825c924b..db21920cd0b20f47367269eebc30f7b800020a86 100644 (file)
@@ -17,7 +17,7 @@ LDFLAGS+= -.o
 .elif ${COMPILER_TYPE} == "gnu"
 CPPFLAGS+= -fno-builtin -ffreestanding -fno-stack-protector
 LDFLAGS+= -T arch/${ARCH}/kernel.lds
-LDFLAGS+= -nostdlib
+LDFLAGS+= -nostdlib -L/usr/gnu/lib
 DPADD+=        ${LIBC}
 LDADD+=        -lc
 .endif
index 44b58a0616fe245a955be9af8c0a2c699a964b76..4b0804cfe6ff93e304c7772417c90e1ad2c71bfa 100644 (file)
@@ -298,7 +298,7 @@ PRIVATE int lapic_enable(void)
        val |= APIC_ENABLE | APIC_SPURIOUS_INT_VECTOR;
        val &= ~APIC_FOCUS_DISABLED;
        lapic_write(LAPIC_SIVR, val);
-       lapic_read(LAPIC_SIVR);
+       (void) lapic_read(LAPIC_SIVR);
 
        *((u32_t *)lapic_eoi_addr) = 0;
 
@@ -337,7 +337,7 @@ PRIVATE int lapic_enable(void)
        /* accept all interrupts */
        lapic_write (LAPIC_TPR, val & ~0xFF);
 
-       lapic_read (LAPIC_SIVR);
+       (void) lapic_read (LAPIC_SIVR);
        *((u32_t *)lapic_eoi_addr) = 0;
 
        apic_calibrate_clocks();
index ee039e3a9359ff27190d25188e2eb38658d633e8..bfbe5a2ab75fbc48b1701848a10c44f543bef219 100644 (file)
@@ -39,14 +39,14 @@ PRIVATE int osfxsr_feature; /* FXSAVE/FXRSTOR instructions support (SSEx) */
 
 FORWARD _PROTOTYPE( void ser_debug, (int c));
 
-PUBLIC void arch_monitor(void)
+PUBLIC __dead void arch_monitor(void)
 {
        monitor();
 }
 
 PUBLIC int cpu_has_tsc;
 
-PUBLIC void arch_shutdown(const int how)
+PUBLIC __dead void arch_shutdown(const int how)
 {
        vm_stop();
 
index 91729e8a0230302a9614de788b345facac5523cb..08557bbd2fe6fb9103e607775180daa3af0f82b4 100644 (file)
@@ -77,7 +77,7 @@ int arch_watchdog_init(void)
 
        /* Setup PC tas NMI for watchdog, is is masked for now */
        lapic_write(LAPIC_LVTPCR, APIC_ICR_INT_MASK | APIC_ICR_DM_NMI);
-       lapic_read(LAPIC_LVTPCR);
+       (void) lapic_read(LAPIC_LVTPCR);
 
        /* double check if LAPIC is enabled */
        if (lapic_addr && watchdog_enabled && watchdog->init) {
index cdc40ab8264be389e7a1beb8eef5832013a42381..5e08220b039245f4225c4a10865039c7cbc88fd2 100644 (file)
@@ -66,8 +66,8 @@ struct exception_frame {
 _PROTOTYPE( void exception, (struct exception_frame * frame));
 
 /* klib386.s */
-_PROTOTYPE( void monitor, (void)                                        );
-_PROTOTYPE( void reset, (void)                                          );
+_PROTOTYPE( __dead void monitor, (void)                                 );
+_PROTOTYPE( __dead void reset, (void)                                   );
 _PROTOTYPE( void int86, (void)                                         );
 _PROTOTYPE( reg_t read_cr0, (void)                                     );
 _PROTOTYPE( reg_t read_cr2, (void)                                     );
index cdb462f26cca82c6ad84ac60d49ddfd6aaa9055e..910f9a5d82ebc253498c4f64d30ce8a6632c8637 100644 (file)
@@ -36,7 +36,7 @@ _PROTOTYPE( void fpu_sigcontext, (struct proc *, struct sigframe *fr, struct sig
 /* main.c */
 _PROTOTYPE( void main, (void)                                          );
 _PROTOTYPE( void prepare_shutdown, (int how)                           );
-_PROTOTYPE( void minix_shutdown, (struct timer *tp)                    );
+_PROTOTYPE( __dead void minix_shutdown, (struct timer *tp)             );
 
 /* proc.c */
 
@@ -166,8 +166,8 @@ _PROTOTYPE( int intr_init, (int, int)                                       );
 _PROTOTYPE( void halt_cpu, (void)                                      );
 _PROTOTYPE( void arch_init, (void)                                     );
 _PROTOTYPE( void ser_putc, (char)                                              );
-_PROTOTYPE( void arch_shutdown, (int)                                  );
-_PROTOTYPE( void arch_monitor, (void)                                  );
+_PROTOTYPE( __dead void arch_shutdown, (int)                           );
+_PROTOTYPE( __dead void arch_monitor, (void)                           );
 _PROTOTYPE( void arch_get_aout_headers, (int i, struct exec *h)                );
 _PROTOTYPE( void restore_user_context, (struct proc * p)                );
 _PROTOTYPE( void read_tsc, (unsigned long *high, unsigned long *low)    );
index e3a1b769a61313c79fa4b96b6b9eb73b9f4defc5..09c3b9bc40bc12da2b1ae9c4a60a3bbc8f000ceb 100644 (file)
@@ -348,7 +348,7 @@ PUBLIC void send_sig(endpoint_t proc_nr, int sig_nr)
        panic("send_sig to empty process: %d",  proc_nr);
 
   rp = proc_addr(proc_nr);
-  sigaddset(&priv(rp)->s_sig_pending, sig_nr);
+  (void) sigaddset(&priv(rp)->s_sig_pending, sig_nr);
   mini_notify(proc_addr(SYSTEM), rp->p_endpoint);
 }
 
@@ -386,14 +386,14 @@ int sig_nr;                       /* signal to be sent */
            panic("cause_sig: signal manager gets lethal signal %d for itself",
                sig_nr);
        }
-       sigaddset(&priv(rp)->s_sig_pending, sig_nr);
+       (void) sigaddset(&priv(rp)->s_sig_pending, sig_nr);
        send_sig(rp->p_endpoint, SIGKSIGSM);
        return;
   }
 
   /* Check if the signal is already pending. Process it otherwise. */
   if (! sigismember(&rp->p_pending, sig_nr)) {
-      sigaddset(&rp->p_pending, sig_nr);
+      (void) sigaddset(&rp->p_pending, sig_nr);
       if (! (RTS_ISSET(rp, RTS_SIGNALED))) {           /* other pending */
          RTS_SET(rp, RTS_SIGNALED | RTS_SIG_PENDING);
           send_sig(sig_mgr, SIGKSIG);
index 81d079c980df6d99600c2bf1febe1667facd963e..49815e5acaa8a8853ac6f1ab93e79fc8a1e744ea 100644 (file)
@@ -117,7 +117,7 @@ PUBLIC int do_fork(struct proc * caller, message * m_ptr)
    * Only one in group should have RTS_SIGNALED, child doesn't inherit tracing.
    */
   RTS_UNSET(rpc, (RTS_SIGNALED | RTS_SIG_PENDING | RTS_P_STOP));
-  sigemptyset(&rpc->p_pending);
+  (void) sigemptyset(&rpc->p_pending);
 
   rpc->p_seg.p_cr3 = 0;
   rpc->p_seg.p_cr3_v = NULL;
index c93cf7ab5b9e958062d47684ff347088e142b89e..561707284789fa4d03568290f2efcbe4cc119568 100644 (file)
@@ -30,7 +30,7 @@ PUBLIC int do_getksig(struct proc * caller, message * m_ptr)
          /* store signaled process' endpoint */
           m_ptr->SIG_ENDPT = rp->p_endpoint;
           m_ptr->SIG_MAP = rp->p_pending;      /* pending signals map */
-          sigemptyset(&rp->p_pending);                 /* clear map in the kernel */
+          (void) sigemptyset(&rp->p_pending);  /* clear map in the kernel */
          RTS_UNSET(rp, RTS_SIGNALED);          /* blocked by SIG_PENDING */
           return(OK);
       }
index aebdfc03b136be0a879445c519bb19420b5c110d..eaefe76bdd316f27a3c329a804899d6f2cc52000 100644 (file)
@@ -98,7 +98,7 @@ PUBLIC int do_privctl(struct proc * caller, message * m_ptr)
        for (i=0; i< NR_SYS_CHUNKS; i++)                /* remove pending: */
              priv(rp)->s_notify_pending.chunk[i] = 0;  /* - notifications */
        priv(rp)->s_int_pending = 0;                    /* - interrupts */
-       sigemptyset(&priv(rp)->s_sig_pending);          /* - signals */
+       (void) sigemptyset(&priv(rp)->s_sig_pending);   /* - signals */
        reset_timer(&priv(rp)->s_alarm_timer);          /* - alarm */
        priv(rp)->s_asyntab= -1;                        /* - asynsends */
        priv(rp)->s_asynsize= 0;