[ruby-core:75530] [Ruby trunk Bug#12383] Warnings when compiling proc.c on cygwin

From: k@...
Date: 2016-05-16 13:27:48 UTC
List: ruby-core #75530
Issue #12383 has been updated by Kazuki Yamaguchi.


I'm also seeing the warning on my Linux box with GCC 6.1.1/5.3.0. Removing "-Wsuggest-attribute=noreturn" from configure.in fixes for me. There is a difference in configure output.

With -Wsuggest-attribute=noreturn:

~~~
checking for __builtin_setjmp... no
checking for setjmp type... _setjmp
~~~

Without -Wsuggest-attribute=noreturn:

~~~
checking for __builtin_setjmp... yes with cast ()
checking for setjmp type... __builtin_setjmp
~~~

The problem is in the check program. -Wsuggest-attribute=noreturn suggests adding noreturn to t(), but this is compiled with -Werror and check fails.

~~~
#include <setjmp.h>
#include <stdio.h>

jmp_buf jb;
void t(void) {__builtin_longjmp((void **) jb, 1);}
int jump(void) {(void)(__builtin_setjmp((void **) jb) ? 1 : 0); return 0;}

int main(void)
{
	void (*volatile f)(void) = t;
	if (!jump()) printf("%d\n", f != 0);
	return 0;
}
~~~


----------------------------------------
Bug #12383: Warnings when compiling proc.c on cygwin
https://bugs.ruby-lang.org/issues/12383#change-58648

* Author: Martin Dürst
* Status: Open
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* ruby -v: ruby 2.4.0dev (2016-05-15 trunk 55004) [x86_64-cygwin]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
When compiling ruby on cygwin, I get the following warnings for proc.c:

```
compiling proc.c
proc.c: In function ‘call_method_data_safe’:
proc.c:1984:11: warning: variable ‘result’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
     VALUE result = Qnil; /* OK */
           ^
proc.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-tautological-compare’
compiling random.c
```



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next