Hi Bibek --

It's the use of CHPL_DEVELOPER=1 that's causing this behavior. By default when CHPL_DEVELOPER is on, we throw flags like -Wall -Werror and the like so that (Chapel compiler/runtime/module) developers can feel confident that they aren't breaking existing behavior.

I'm not personally familiar with -Wno-maybe-uninitialized, and am wondering whether it's in newer versions of gcc than the ones I use. If you look in make/compiler/Makefile.gnu, you'll see some macros that add -Wno-uninitialized to *WARN_GEN_CFLAGS, and that would be the most consistent place to add a new -Wno* flag to override something that we don't want from -Werror.

Generally, in the past, for -Wno-uninitialized, we've taken the stance that we'd rather not pay the performance penalty for assuring the C compiler that a variable is initialized if we're confident that it is, and have relied on valgrind to catch our lies rather than the necessarily conservative static analysis of a C compiler.

-Brad


On Mon, 6 Jul 2015, Bibek Ghimire wrote:

Hi all,
      I have built chapel with following environmental variable for the
debugging mode.

   if [ "$1" == "debug" ]; then
             echo "Debugging mode on"
             export CHPL_DEVELOPER=1
             export CHPL_COMM_DEBUG=1
             export CHPL_GASNET_DEBUG=1
             export GASNET_BACKTRACE=1
             export CHPL_DEBUG=1
       fi

The chapel compiles with no error. The hello world compiles fine. Then when
I try to compile the lulesh from the benchmark directory I get

In file included from /tmp/chpl-xxxxx-29352.deleteme/_main.c:49:0:
/tmp/chpl-xxxxx-29352.deleteme/IO.c: In function ‘open_chpl.constprop’:
/tmp/chpl-xxxxx-29352.deleteme/IO.c:1787:9: error: ‘type_tmp_chpl’ may be
used uninitialized in this function [-Werror=maybe-uninitialized]
fs_chpl = type_tmp_chpl;
        ^
/tmp/chpl-xxxxx-29352.deleteme/IO.c:2106:15: error:
‘_formal_tmp_error_chpl’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
*(error_chpl) = _formal_tmp_error_chpl;
              ^
In file included from /tmp/chpl-xxxxx-29352.deleteme/_main.c:19:0:
/tmp/chpl-xxxxx-29352.deleteme/ChapelStandard.c: In function
‘chpl__init_ChapelStandard’:
/tmp/chpl-xxxxx-29352.deleteme/LocaleModel.c:676:24: error:
‘this30.dummyFieldToAvoidWarning’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
(_args_foron_fn)->_2_b = b;
                       ^
/tmp/chpl-xxxxx-29352.deleteme/LocaleModel.c:532:16: note:
‘this30.dummyFieldToAvoidWarning’ was declared here
localesBarrier this30;
               ^
cc1: all warnings being treated as errors
make[1]: *** [/tmp/chpl-xxxxx-29352.deleteme/lulesh.tmp] Error 1
error: compiling generated source [mysystem.cpp:43]
make: *** [lulesh] Error 1

Should I turn off the compiler flag -Werror=maybe-uninitialized? If yes
where is this compiler flag set from?


fyi - gcc-4.9.2


-Bibek
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to