[compiler-rt] r248346 - [builtins] Fixing broken bot building on linux with -Werror

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 16:38:07 PDT 2015


On Tue, Sep 22, 2015 at 7:35 PM, Chris Bieneman via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: cbieneman
> Date: Tue Sep 22 18:35:24 2015
> New Revision: 248346
>
> URL: http://llvm.org/viewvc/llvm-project?rev=248346&view=rev
> Log:
> [builtins] Fixing broken bot building on linux with -Werror
>
> Returning a void expression is bad.

Why is returning a void expression bad? Also, why do these require
return statements at all?

~Aaron

>
> Modified:
>     compiler-rt/trunk/lib/builtins/atomic_flag_clear.c
>     compiler-rt/trunk/lib/builtins/atomic_flag_clear_explicit.c
>
> Modified: compiler-rt/trunk/lib/builtins/atomic_flag_clear.c
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/atomic_flag_clear.c?rev=248346&r1=248345&r2=248346&view=diff
> ==============================================================================
> --- compiler-rt/trunk/lib/builtins/atomic_flag_clear.c (original)
> +++ compiler-rt/trunk/lib/builtins/atomic_flag_clear.c Tue Sep 22 18:35:24 2015
> @@ -21,7 +21,8 @@
>  #include <stdatomic.h>
>  #undef atomic_flag_clear
>  void atomic_flag_clear(volatile atomic_flag *object) {
> -  return __c11_atomic_store(&(object)->_Value, 0, __ATOMIC_SEQ_CST);
> +  __c11_atomic_store(&(object)->_Value, 0, __ATOMIC_SEQ_CST);
> +  return;
>  }
>
>  #endif
>
> Modified: compiler-rt/trunk/lib/builtins/atomic_flag_clear_explicit.c
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/atomic_flag_clear_explicit.c?rev=248346&r1=248345&r2=248346&view=diff
> ==============================================================================
> --- compiler-rt/trunk/lib/builtins/atomic_flag_clear_explicit.c (original)
> +++ compiler-rt/trunk/lib/builtins/atomic_flag_clear_explicit.c Tue Sep 22 18:35:24 2015
> @@ -22,7 +22,8 @@
>  #undef atomic_flag_clear_explicit
>  void atomic_flag_clear_explicit(volatile atomic_flag *object,
>                                  memory_order order) {
> -  return __c11_atomic_store(&(object)->_Value, 0, order);
> +  __c11_atomic_store(&(object)->_Value, 0, order);
> +  return;
>  }
>
>  #endif
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list