[PATCH] Avoid starting a comment with */*

Thomas Klausner wiz at NetBSD.org
Mon Mar 10 22:45:19 PDT 2014


On Mon, Mar 10, 2014 at 06:31:33PM -0400, Peter Harris wrote:
> Even though -Wcomment doesn't mind it (in gcc or clang), the appearance
> of */* confuses the syntax highlighter of some editors (eg. vim), and
> causes warnings in MSVC.
> 
> Signed-off-by: Peter Harris <pharris at opentext.com>
...
> diff --git a/include/callback.h b/include/callback.h
> index df638c0..fe7015e 100644
> --- a/include/callback.h
> +++ b/include/callback.h
> @@ -64,16 +64,16 @@ typedef struct _CallbackList *CallbackListPtr;  /* also in misc.h */
>  
>  typedef void (*CallbackProcPtr) (CallbackListPtr *, void *, void *);
>  
> -extern _X_EXPORT Bool AddCallback(CallbackListPtr * /*pcbl */ ,
> -                                  CallbackProcPtr /*callback */ ,
> -                                  void */*data */ );
> +extern _X_EXPORT Bool AddCallback(CallbackListPtr *pcbl,
> +                                  CallbackProcPtr callback,
> +                                  void *data);

I was always told that I should avoid function argument names in
prototypes in header files because they can break when macros are
used; but this patch adds such names.

Does adding a space in '*/*', i.e. making it '* /*', also work?

Like this:
extern _X_EXPORT Bool AddCallback(CallbackListPtr * /* pcbl */,
                                  CallbackProcPtr /* callback */,
                                  void * /* data */);

 Thomas


More information about the xorg-devel mailing list