Skip to content

Commit 97c40a2

Browse files
committed
Muzzle -O2 -Wmaybe-uninitialized.
This results from the inlining of call_basic() into GpuElemwise_call(), and the compiler's inability to verify that 1) The various "uninitialized" values will be used only if err == GA_NO_ERROR 2) The above-mentioned values are indeed initialized when err == GA_NO_ERROR.
1 parent 430dc93 commit 97c40a2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/gpuarray_elemwise.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -740,12 +740,12 @@ void GpuElemwise_free(GpuElemwise *ge) {
740740
}
741741

742742
int GpuElemwise_call(GpuElemwise *ge, void **args, int flags) {
743-
size_t n;
744-
size_t *dims;
745-
ssize_t **strides;
746-
unsigned int nd;
747-
int contig;
748-
int call32;
743+
size_t n = 0;
744+
size_t *dims = NULL;
745+
ssize_t **strides = NULL;
746+
unsigned int nd = 0;
747+
int contig = 0;
748+
int call32 = 0;
749749
int err;
750750

751751
err = check_contig(ge, args, &n, &contig);

0 commit comments

Comments
 (0)