[llvm] r193249 - Mark zero-argument functions explicitly in C headers.

Alp Toker alp at nuanti.com
Wed Oct 23 10:19:34 PDT 2013


Good catch.

It'd be neat to automate this check for the llvm / clang public C
headers with a build target like:

 -Wall -Wextra -Werror -std=c89 -pedantic -Wmissing-prototypes
-Wstrict-prototypes -Wold-style-definition

Alp.


On 23/10/2013 17:57, Benjamin Kramer wrote:
> Author: d0k
> Date: Wed Oct 23 11:57:34 2013
> New Revision: 193249
>
> URL: http://llvm.org/viewvc/llvm-project?rev=193249&view=rev
> Log:
> Mark zero-argument functions explicitly in C headers.
>
> Pacifies GCC's -Wstrict-prototypes.
>
> Modified:
>     llvm/trunk/include/llvm-c/Core.h
>
> Modified: llvm/trunk/include/llvm-c/Core.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=193249&r1=193248&r2=193249&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm-c/Core.h (original)
> +++ llvm/trunk/include/llvm-c/Core.h Wed Oct 23 11:57:34 2013
> @@ -408,7 +408,7 @@ void LLVMInitializeCore(LLVMPassRegistry
>  /** Deallocate and destroy all ManagedStatic variables.
>      @see llvm::llvm_shutdown
>      @see ManagedStatic */
> -void LLVMShutdown();
> +void LLVMShutdown(void);
>  
>  
>  /*===-- Error handling ----------------------------------------------------===*/
> @@ -2748,16 +2748,16 @@ void LLVMDisposePassManager(LLVMPassMana
>      initialization succeeded. Must be executed in isolation from all
>      other LLVM api calls.
>      @see llvm::llvm_start_multithreaded */
> -LLVMBool LLVMStartMultithreaded();
> +LLVMBool LLVMStartMultithreaded(void);
>  
>  /** Deallocate structures necessary to make LLVM safe for multithreading.
>      Must be executed in isolation from all other LLVM api calls.
>      @see llvm::llvm_stop_multithreaded */
> -void LLVMStopMultithreaded();
> +void LLVMStopMultithreaded(void);
>  
>  /** Check whether LLVM is executing in thread-safe mode or not.
>      @see llvm::llvm_is_multithreaded */
> -LLVMBool LLVMIsMultithreaded();
> +LLVMBool LLVMIsMultithreaded(void);
>  
>  /**
>   * @}
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-- 
http://www.nuanti.com
the browser experts




More information about the llvm-commits mailing list