You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Nitay Joffe (JIRA)" <ji...@apache.org> on 2009/04/10 11:30:12 UTC
[jira] Created: (ZOOKEEPER-374) Uninitialized struct variable in C
causes warning which is treated as an error
Uninitialized struct variable in C causes warning which is treated as an error
------------------------------------------------------------------------------
Key: ZOOKEEPER-374
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
Project: Zookeeper
Issue Type: Bug
Components: c client
Affects Versions: 3.1.1
Reporter: Nitay Joffe
nitay-joffes-macbook-pro:c nitay$ pwd
/Users/nitay/code/zookeeper/src/c
nitay-joffes-macbook-pro:c nitay$ make
make all-am
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
cc1: warnings being treated as errors
src/zookeeper.c: In function 'zoo_add_auth':
src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
make[1]: *** [zookeeper.lo] Error 1
make: *** [all] Error 2
Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-374) Uninitialized struct variable in C
causes warning which is treated as an error
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Hunt updated ZOOKEEPER-374:
-----------------------------------
Status: Patch Available (was: Open)
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Environment: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
> Reporter: Nitay Joffe
> Assignee: Patrick Hunt
> Priority: Trivial
> Fix For: 3.2.0
>
> Attachments: ZOOKEEPER-374.patch
>
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-374) Uninitialized struct variable in
C causes warning which is treated as an error
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699844#action_12699844 ]
Mahadev konar commented on ZOOKEEPER-374:
-----------------------------------------
+1 for the patch.. the test fails on java test case LETest which the patch has ntohing to do with.
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Environment: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
> Reporter: Nitay Joffe
> Assignee: Patrick Hunt
> Priority: Trivial
> Fix For: 3.2.0
>
> Attachments: ZOOKEEPER-374.patch
>
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-374) Uninitialized struct variable in C
causes warning which is treated as an error
Posted by "Nitay Joffe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nitay Joffe updated ZOOKEEPER-374:
----------------------------------
Environment: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Environment: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
> Reporter: Nitay Joffe
> Priority: Trivial
> Fix For: 3.2.0
>
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-374) Uninitialized struct variable in
C causes warning which is treated as an error
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698968#action_12698968 ]
Patrick Hunt commented on ZOOKEEPER-374:
----------------------------------------
Interesting, with gcc (Ubuntu 4.3.2-1ubuntu12) 4.3.2
this warning is not output by the compiler. Seems that the newer version
of the compiler is able to determine that auth is only accessed (written/read) when the following
condition is true:
if(cert!=NULL && certLen!=0){
as a result it doesn't complain in this instance on my system.
I'll submit a patch for this to work on older gccs.
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Environment: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
> Reporter: Nitay Joffe
> Priority: Trivial
> Fix For: 3.2.0
>
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-374) Uninitialized struct variable in C
causes warning which is treated as an error
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mahadev konar updated ZOOKEEPER-374:
------------------------------------
Resolution: Fixed
Hadoop Flags: [Reviewed]
Status: Resolved (was: Patch Available)
I just committed this. thanks pat.
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Environment: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
> Reporter: Nitay Joffe
> Assignee: Patrick Hunt
> Priority: Trivial
> Fix For: 3.2.0
>
> Attachments: ZOOKEEPER-374.patch
>
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-374) Uninitialized struct variable in C
causes warning which is treated as an error
Posted by "Nitay Joffe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nitay Joffe updated ZOOKEEPER-374:
----------------------------------
Priority: Trivial (was: Major)
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Reporter: Nitay Joffe
> Priority: Trivial
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-374) Uninitialized struct variable in
C causes warning which is treated as an error
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699580#action_12699580 ]
Hadoop QA commented on ZOOKEEPER-374:
-------------------------------------
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12405500/ZOOKEEPER-374.patch
against trunk revision 764673.
+1 @author. The patch does not contain any @author tags.
+1 tests included. The patch appears to include 3 new or modified tests.
+1 javadoc. The javadoc tool did not generate any warning messages.
+1 javac. The applied patch does not increase the total number of javac compiler warnings.
+1 findbugs. The patch does not introduce any new Findbugs warnings.
+1 release audit. The applied patch does not increase the total number of release audit warnings.
-1 core tests. The patch failed core unit tests.
+1 contrib tests. The patch passed contrib unit tests.
Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/32/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/32/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/32/console
This message is automatically generated.
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Environment: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
> Reporter: Nitay Joffe
> Assignee: Patrick Hunt
> Priority: Trivial
> Fix For: 3.2.0
>
> Attachments: ZOOKEEPER-374.patch
>
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-374) Uninitialized struct variable in
C causes warning which is treated as an error
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700157#action_12700157 ]
Hudson commented on ZOOKEEPER-374:
----------------------------------
Integrated in ZooKeeper-trunk #283 (See [http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/283/])
. Uninitialized struct variable in C causes warning which is treated as an error (phunt via mahadev)
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Environment: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
> Reporter: Nitay Joffe
> Assignee: Patrick Hunt
> Priority: Trivial
> Fix For: 3.2.0
>
> Attachments: ZOOKEEPER-374.patch
>
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (ZOOKEEPER-374) Uninitialized struct variable in C
causes warning which is treated as an error
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Hunt reassigned ZOOKEEPER-374:
--------------------------------------
Assignee: Patrick Hunt
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Environment: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
> Reporter: Nitay Joffe
> Assignee: Patrick Hunt
> Priority: Trivial
> Fix For: 3.2.0
>
> Attachments: ZOOKEEPER-374.patch
>
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-374) Uninitialized struct variable in C
causes warning which is treated as an error
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mahadev konar updated ZOOKEEPER-374:
------------------------------------
Fix Version/s: 3.2.0
what version of gcc is this? Anyways we should fix it in 3.2
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Reporter: Nitay Joffe
> Priority: Trivial
> Fix For: 3.2.0
>
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-374) Uninitialized struct variable in C
causes warning which is treated as an error
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Hunt updated ZOOKEEPER-374:
-----------------------------------
Attachment: ZOOKEEPER-374.patch
fixed warning and added tests to verify
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Environment: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
> Reporter: Nitay Joffe
> Priority: Trivial
> Fix For: 3.2.0
>
> Attachments: ZOOKEEPER-374.patch
>
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-374) Uninitialized struct variable in
C causes warning which is treated as an error
Posted by "Nitay Joffe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699124#action_12699124 ]
Nitay Joffe commented on ZOOKEEPER-374:
---------------------------------------
+1. Works for me.
> Uninitialized struct variable in C causes warning which is treated as an error
> ------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-374
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-374
> Project: Zookeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.1.1
> Environment: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
> Reporter: Nitay Joffe
> Assignee: Patrick Hunt
> Priority: Trivial
> Fix For: 3.2.0
>
> Attachments: ZOOKEEPER-374.patch
>
>
> nitay-joffes-macbook-pro:c nitay$ pwd
> /Users/nitay/code/zookeeper/src/c
> nitay-joffes-macbook-pro:c nitay$ make
> make all-am
> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
> cc1: warnings being treated as errors
> src/zookeeper.c: In function 'zoo_add_auth':
> src/zookeeper.c:2378: warning: 'auth.buff' may be used uninitialized in this function
> src/zookeeper.c:2378: warning: 'auth.len' may be used uninitialized in this function
> make[1]: *** [zookeeper.lo] Error 1
> make: *** [all] Error 2
> Need to set auth.buff and auth.len to zero.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.