Issue #7756 has been reported by drbrain (Eric Hodel). ---------------------------------------- Bug #7756: clang 3.2 sees through UNINITIALIZED_VAR macro, gives warning https://bugs.ruby-lang.org/issues/7756 Author: drbrain (Eric Hodel) Status: Open Priority: Normal Assignee: Category: core Target version: 2.0.0 ruby -v: - =begin In clang 3.2, the UNINITIALIZED_VAR macro does not prevent the compiler from producing a warning. Apple clang 3.2: $ clang -v Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.1 Thread model: posix When compiling thread.c: compiling ../trunk/thread.c ../trunk/thread.c:3261:34: warning: variable 'orig_read' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_read); ^~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3262:34: warning: variable 'orig_write' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_write); ^~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3263:34: warning: variable 'orig_except' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_except); ^~~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ 3 warnings generated. =end
on 2013-01-29 21:05
on 2013-01-29 21:33
Issue #7756 has been updated by kosaki (Motohiro KOSAKI). Hm, maybe we need another workaround. Does __attribute__ (unused) works on your compiler? likes #ifdef __GNUC__ #define UNINITIALIZED_VAR(x) x __attribute__ (unused) = x #else .... ---------------------------------------- Bug #7756: clang 3.2 sees through UNINITIALIZED_VAR macro, gives warning https://bugs.ruby-lang.org/issues/7756#change-35706 Author: drbrain (Eric Hodel) Status: Open Priority: Normal Assignee: Category: core Target version: 2.0.0 ruby -v: - =begin In clang 3.2, the UNINITIALIZED_VAR macro does not prevent the compiler from producing a warning. Apple clang 3.2: $ clang -v Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.1 Thread model: posix When compiling thread.c: compiling ../trunk/thread.c ../trunk/thread.c:3261:34: warning: variable 'orig_read' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_read); ^~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3262:34: warning: variable 'orig_write' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_write); ^~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3263:34: warning: variable 'orig_except' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_except); ^~~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ 3 warnings generated. =end
on 2013-01-30 00:54
Issue #7756 has been updated by drbrain (Eric Hodel). =begin This patch works: Index: vm_core.h =================================================================== --- vm_core.h (revision 38980) +++ vm_core.h (working copy) @@ -116,7 +116,7 @@ #endif /* __GNUC__ >= 3 */ #if __GNUC__ >= 3 -#define UNINITIALIZED_VAR(x) x = x +#define UNINITIALIZED_VAR(x) x __attribute__((unused)) #else #define UNINITIALIZED_VAR(x) x #endif =end ---------------------------------------- Bug #7756: clang 3.2 sees through UNINITIALIZED_VAR macro, gives warning https://bugs.ruby-lang.org/issues/7756#change-35710 Author: drbrain (Eric Hodel) Status: Open Priority: Normal Assignee: Category: core Target version: 2.0.0 ruby -v: - =begin In clang 3.2, the UNINITIALIZED_VAR macro does not prevent the compiler from producing a warning. Apple clang 3.2: $ clang -v Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.1 Thread model: posix When compiling thread.c: compiling ../trunk/thread.c ../trunk/thread.c:3261:34: warning: variable 'orig_read' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_read); ^~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3262:34: warning: variable 'orig_write' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_write); ^~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3263:34: warning: variable 'orig_except' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_except); ^~~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ 3 warnings generated. =end
on 2013-02-17 05:50
Issue #7756 has been updated by ko1 (Koichi Sasada). Assignee set to mame (Yusuke Endoh) mame-san, how about it? ---------------------------------------- Bug #7756: clang 3.2 sees through UNINITIALIZED_VAR macro, gives warning https://bugs.ruby-lang.org/issues/7756#change-36359 Author: drbrain (Eric Hodel) Status: Open Priority: Normal Assignee: mame (Yusuke Endoh) Category: core Target version: 2.0.0 ruby -v: - =begin In clang 3.2, the UNINITIALIZED_VAR macro does not prevent the compiler from producing a warning. Apple clang 3.2: $ clang -v Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.1 Thread model: posix When compiling thread.c: compiling ../trunk/thread.c ../trunk/thread.c:3261:34: warning: variable 'orig_read' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_read); ^~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3262:34: warning: variable 'orig_write' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_write); ^~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3263:34: warning: variable 'orig_except' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_except); ^~~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ 3 warnings generated. =end
on 2013-02-17 06:47
Issue #7756 has been updated by mame (Yusuke Endoh). Target version changed from 2.0.0 to next minor It emits just a warning, not an error, right? Looks not significant. -- Yusuke Endoh <mame@tsg.ne.jp> ---------------------------------------- Bug #7756: clang 3.2 sees through UNINITIALIZED_VAR macro, gives warning https://bugs.ruby-lang.org/issues/7756#change-36389 Author: drbrain (Eric Hodel) Status: Open Priority: Normal Assignee: mame (Yusuke Endoh) Category: core Target version: next minor ruby -v: - =begin In clang 3.2, the UNINITIALIZED_VAR macro does not prevent the compiler from producing a warning. Apple clang 3.2: $ clang -v Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.1 Thread model: posix When compiling thread.c: compiling ../trunk/thread.c ../trunk/thread.c:3261:34: warning: variable 'orig_read' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_read); ^~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3262:34: warning: variable 'orig_write' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_write); ^~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3263:34: warning: variable 'orig_except' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_except); ^~~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ 3 warnings generated. =end
on 2013-02-17 18:32
Issue #7756 has been updated by drbrain (Eric Hodel). It is only a warning ---------------------------------------- Bug #7756: clang 3.2 sees through UNINITIALIZED_VAR macro, gives warning https://bugs.ruby-lang.org/issues/7756#change-36448 Author: drbrain (Eric Hodel) Status: Open Priority: Normal Assignee: mame (Yusuke Endoh) Category: core Target version: next minor ruby -v: - =begin In clang 3.2, the UNINITIALIZED_VAR macro does not prevent the compiler from producing a warning. Apple clang 3.2: $ clang -v Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.1 Thread model: posix When compiling thread.c: compiling ../trunk/thread.c ../trunk/thread.c:3261:34: warning: variable 'orig_read' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_read); ^~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3262:34: warning: variable 'orig_write' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_write); ^~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3263:34: warning: variable 'orig_except' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_except); ^~~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ 3 warnings generated. =end
on 2013-03-12 01:24
Issue #7756 has been updated by nobu (Nobuyoshi Nakada). Unfortunately, it doesn't shut up gcc-4.7. thread.c: In function 'do_select': thread.c:3155:26: warning: 'orig_except.fdset' may be used uninitialized in this function [-Wmaybe-uninitialized] thread.c:3352:16: note: 'orig_except.fdset' was declared here thread.c:3229:19: warning: 'orig_except.maxfd' may be used uninitialized in this function [-Wmaybe-uninitialized] thread.c:3352:16: note: 'orig_except.maxfd' was declared here thread.c:3155:26: warning: 'orig_write.fdset' may be used uninitialized in this function [-Wmaybe-uninitialized] thread.c:3351:16: note: 'orig_write.fdset' was declared here thread.c:3229:19: warning: 'orig_write.maxfd' may be used uninitialized in this function [-Wmaybe-uninitialized] thread.c:3351:16: note: 'orig_write.maxfd' was declared here thread.c:3155:26: warning: 'orig_read.fdset' may be used uninitialized in this function [-Wmaybe-uninitialized] thread.c:3350:16: note: 'orig_read.fdset' was declared here thread.c:3229:19: warning: 'orig_read.maxfd' may be used uninitialized in this function [-Wmaybe-uninitialized] thread.c:3350:16: note: 'orig_read.maxfd' was declared here ---------------------------------------- Bug #7756: clang 3.2 sees through UNINITIALIZED_VAR macro, gives warning https://bugs.ruby-lang.org/issues/7756#change-37520 Author: drbrain (Eric Hodel) Status: Open Priority: Normal Assignee: mame (Yusuke Endoh) Category: core Target version: next minor ruby -v: - =begin In clang 3.2, the UNINITIALIZED_VAR macro does not prevent the compiler from producing a warning. Apple clang 3.2: $ clang -v Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.1 Thread model: posix When compiling thread.c: compiling ../trunk/thread.c ../trunk/thread.c:3261:34: warning: variable 'orig_read' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_read); ^~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3262:34: warning: variable 'orig_write' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_write); ^~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3263:34: warning: variable 'orig_except' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_except); ^~~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ 3 warnings generated. =end
on 2013-03-12 07:11
Issue #7756 has been updated by naruse (Yui NARUSE). GCC 4.6 and clang (2.8?) supports pragma diagnostic, but its syntax is different from current UNINITIALIZED_VAR(). #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wuninitialized" blah blah #pragma GCC diagnostic pop http://gcc.gnu.org/gcc-4.6/changes.html http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html http://clang.llvm.org/docs/UsersManual.html#contro... ---------------------------------------- Bug #7756: clang 3.2 sees through UNINITIALIZED_VAR macro, gives warning https://bugs.ruby-lang.org/issues/7756#change-37525 Author: drbrain (Eric Hodel) Status: Open Priority: Normal Assignee: mame (Yusuke Endoh) Category: core Target version: next minor ruby -v: - =begin In clang 3.2, the UNINITIALIZED_VAR macro does not prevent the compiler from producing a warning. Apple clang 3.2: $ clang -v Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.1 Thread model: posix When compiling thread.c: compiling ../trunk/thread.c ../trunk/thread.c:3261:34: warning: variable 'orig_read' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_read); ^~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3262:34: warning: variable 'orig_write' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_write); ^~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3263:34: warning: variable 'orig_except' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_except); ^~~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ 3 warnings generated. =end
on 2013-03-19 18:12
Issue #7756 has been updated by naruse (Yui NARUSE).
A macro can be following, but it still changes syntax from current
UNINITIALIZED_VAR.
#if GCC_VERSION_SINCE(4,6,0) || defined(__clang__)
# define SUPPRESS_DIAGNOSTIC(arg,rest) \
_Pragma("GCC diagnostic push") \
_Pragma(STRINGIZE(GCC diagnostic ignored arg)) \
rest \
_Pragma("GCC diagnostic pop")
#else
# define SUPPRESS_DIAGNOSTIC(arg,rest) rest
#endif
----------------------------------------
Bug #7756: clang 3.2 sees through UNINITIALIZED_VAR macro, gives warning
https://bugs.ruby-lang.org/issues/7756#change-37741
Author: drbrain (Eric Hodel)
Status: Open
Priority: Normal
Assignee: mame (Yusuke Endoh)
Category: core
Target version: next minor
ruby -v: -
=begin
In clang 3.2, the UNINITIALIZED_VAR macro does not prevent the compiler
from producing a warning.
Apple clang 3.2:
$ clang -v
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.2.1
Thread model: posix
When compiling thread.c:
compiling ../trunk/thread.c
../trunk/thread.c:3261:34: warning: variable 'orig_read' is
uninitialized when
used within its own initialization [-Wuninitialized]
rb_fdset_t UNINITIALIZED_VAR(orig_read);
^~~~~~~~~
../trunk/vm_core.h:119:34: note: expanded from macro
'UNINITIALIZED_VAR'
#define UNINITIALIZED_VAR(x) x = x
^
../trunk/thread.c:3262:34: warning: variable 'orig_write' is
uninitialized when
used within its own initialization [-Wuninitialized]
rb_fdset_t UNINITIALIZED_VAR(orig_write);
^~~~~~~~~~
../trunk/vm_core.h:119:34: note: expanded from macro
'UNINITIALIZED_VAR'
#define UNINITIALIZED_VAR(x) x = x
^
../trunk/thread.c:3263:34: warning: variable 'orig_except' is
uninitialized when
used within its own initialization [-Wuninitialized]
rb_fdset_t UNINITIALIZED_VAR(orig_except);
^~~~~~~~~~~
../trunk/vm_core.h:119:34: note: expanded from macro
'UNINITIALIZED_VAR'
#define UNINITIALIZED_VAR(x) x = x
^
3 warnings generated.
=end
on 2013-03-21 05:51
Issue #7756 has been updated by nobu (Nobuyoshi Nakada). Subject changed from clang 3.2 sees through UNINITIALIZED_VAR macro, gives warning to clang 4.2 sees through UNINITIALIZED_VAR macro, gives warning ---------------------------------------- Bug #7756: clang 4.2 sees through UNINITIALIZED_VAR macro, gives warning https://bugs.ruby-lang.org/issues/7756#change-37783 Author: drbrain (Eric Hodel) Status: Open Priority: Normal Assignee: mame (Yusuke Endoh) Category: core Target version: next minor ruby -v: - =begin In clang 3.2, the UNINITIALIZED_VAR macro does not prevent the compiler from producing a warning. Apple clang 3.2: $ clang -v Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.1 Thread model: posix When compiling thread.c: compiling ../trunk/thread.c ../trunk/thread.c:3261:34: warning: variable 'orig_read' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_read); ^~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3262:34: warning: variable 'orig_write' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_write); ^~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ ../trunk/thread.c:3263:34: warning: variable 'orig_except' is uninitialized when used within its own initialization [-Wuninitialized] rb_fdset_t UNINITIALIZED_VAR(orig_except); ^~~~~~~~~~~ ../trunk/vm_core.h:119:34: note: expanded from macro 'UNINITIALIZED_VAR' #define UNINITIALIZED_VAR(x) x = x ^ 3 warnings generated. =end
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.