hanchenye-llvm-project/openmp
Samuel Antao 11e4c539f4 Initialize two variables in kmp_tasking.
Summary:
Two initialized local variables are causing clang to produce warnings:

```
./src/projects/openmp/runtime/src/kmp_tasking.c:3019:5: error: variable 'num_tasks' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
    default:
    ^~~~~~~
./src/projects/openmp/runtime/src/kmp_tasking.c:3027:21: note: uninitialized use occurs here
    for( i = 0; i < num_tasks; ++i ) {
                    ^~~~~~~~~
./src/projects/openmp/runtime/src/kmp_tasking.c:2968:28: note: initialize the variable 'num_tasks' to silence this warning
    kmp_uint64 i, num_tasks, extras;
                           ^
                            = 0
./src/projects/openmp/runtime/src/kmp_tasking.c:3019:5: error: variable 'extras' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
    default:
    ^~~~~~~
./src/projects/openmp/runtime/src/kmp_tasking.c:3022:52: note: uninitialized use occurs here
    KMP_DEBUG_ASSERT(tc == num_tasks * grainsize + extras);
                                                   ^~~~~~
./src/projects/openmp/runtime/src/kmp_debug.h:62:60: note: expanded from macro 'KMP_DEBUG_ASSERT'
        #define KMP_DEBUG_ASSERT( cond )       KMP_ASSERT( cond )
                                                           ^
./src/projects/openmp/runtime/src/kmp_debug.h:60:51: note: expanded from macro 'KMP_ASSERT'
        #define KMP_ASSERT( cond )             ( (cond) ? 0 : __kmp_debug_assert( #cond, __FILE__, __LINE__ ) )
                                                  ^
./src/projects/openmp/runtime/src/kmp_tasking.c:2968:36: note: initialize the variable 'extras' to silence this warning
    kmp_uint64 i, num_tasks, extras;
                                   ^
                                    = 0
2 errors generated.
```

This patch initializes these two variables.

Reviewers: tlwilmar, jlpeyton

Subscribers: tlwilmar, openmp-commits

Differential Revision: http://reviews.llvm.org/D17909

llvm-svn: 263316
2016-03-12 00:55:17 +00:00
..
offload Liboffload: Patch for MPSS > 3.4.x (provided by Tim Cramer) 2015-05-06 10:58:40 +00:00
runtime Initialize two variables in kmp_tasking. 2016-03-12 00:55:17 +00:00
testsuite Apply name change to testsuite file. 2015-06-01 04:24:23 +00:00
www Update Reference.pdf files. 2015-09-23 18:09:47 +00:00
CMakeLists.txt [CMake] Introduce OPENMP_LLVM_TOOLS_DIR 2016-02-05 07:00:13 +00:00
CREDITS.txt This patch contains the new files for OMPT and the needed changes to the build infrastructure 2015-04-29 16:22:07 +00:00
LICENSE.txt updated copyright date to 2015 2015-04-16 11:10:17 +00:00