Commit dc5555d
committed
Fix -Wmaybe-uninitialized
../namespace.c: In function ‘current_namespace’:
../namespace.c:221:48: warning: ‘proc_ns’ may be used uninitialized [-Wmaybe-uninitialized]
221 | if (permit_calling_builtin || (proc_ns && NAMESPACE_USER_P(proc_ns)))
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../namespace.c:204:31: note: ‘proc_ns’ was declared here
204 | const rb_namespace_t *proc_ns;
| ^~~~~~~
In function ‘copy_ext_file’,
inlined from ‘rb_namespace_local_extension’ at ../namespace.c:855:18:
../namespace.c:768:21: warning: ‘written’ may be used uninitialized [-Wmaybe-uninitialized]
768 | wrote = fwrite(buffer+written, 1, read-written, dst);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../namespace.c: In function ‘rb_namespace_local_extension’:
../namespace.c:748:25: note: ‘written’ was declared here
748 | size_t read, wrote, written;
| ^~~~~~~
In function ‘copy_ext_file’,
inlined from ‘rb_namespace_local_extension’ at ../namespace.c:855:18:
../namespace.c:768:21: warning: ‘read’ may be used uninitialized [-Wmaybe-uninitialized]
768 | wrote = fwrite(buffer+written, 1, read-written, dst);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../namespace.c: In function ‘rb_namespace_local_extension’:
../namespace.c:748:12: note: ‘read’ was declared here
748 | size_t read, wrote, written;
| ^~~~1 parent 8b7a4d1 commit dc5555d
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
748 | | - | |
| 748 | + | |
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
| |||
0 commit comments