lkml.org 
[lkml]   [2006]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 04/17] uml: request format warnings to GCC for appropriate functions
    Date
    From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

    Add the format attribute to prototypes so GCC warns about improper usage.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
    ---

    arch/um/include/tt/tt.h | 3 ++-
    arch/um/include/user.h | 6 ++++--
    arch/um/include/user_util.h | 3 ++-
    3 files changed, 8 insertions(+), 4 deletions(-)

    diff --git a/arch/um/include/tt/tt.h b/arch/um/include/tt/tt.h
    index 8085219..acb8356 100644
    --- a/arch/um/include/tt/tt.h
    +++ b/arch/um/include/tt/tt.h
    @@ -19,7 +19,8 @@ extern int fork_tramp(void *sig_stack);
    extern int do_proc_op(void *t, int proc_id);
    extern int tracer(int (*init_proc)(void *), void *sp);
    extern void attach_process(int pid);
    -extern void tracer_panic(char *format, ...);
    +extern void tracer_panic(char *format, ...)
    + __attribute__ ((format (printf, 1, 2)));
    extern void set_init_pid(int pid);
    extern int set_user_mode(void *task);
    extern void set_tracing(void *t, int tracing);
    diff --git a/arch/um/include/user.h b/arch/um/include/user.h
    index 91b0ac4..39f8c88 100644
    --- a/arch/um/include/user.h
    +++ b/arch/um/include/user.h
    @@ -6,8 +6,10 @@
    #ifndef __USER_H__
    #define __USER_H__

    -extern void panic(const char *fmt, ...);
    -extern int printk(const char *fmt, ...);
    +extern void panic(const char *fmt, ...)
    + __attribute__ ((format (printf, 1, 2)));
    +extern int printk(const char *fmt, ...)
    + __attribute__ ((format (printf, 1, 2)));
    extern void schedule(void);
    extern void *um_kmalloc(int size);
    extern void *um_kmalloc_atomic(int size);
    diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h
    index fe0c29b..802d784 100644
    --- a/arch/um/include/user_util.h
    +++ b/arch/um/include/user_util.h
    @@ -55,7 +55,8 @@ extern int get_pty(void);
    extern void *um_kmalloc(int size);
    extern int switcheroo(int fd, int prot, void *from, void *to, int size);
    extern void do_exec(int old_pid, int new_pid);
    -extern void tracer_panic(char *msg, ...);
    +extern void tracer_panic(char *msg, ...)
    + __attribute__ ((format (printf, 1, 2)));
    extern int detach(int pid, int sig);
    extern int attach(int pid);
    extern void kill_child_dead(int pid);
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2006-04-07 16:36    [W:5.705 / U:0.236 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site