Bug 150665 - local variable used before set
Summary: local variable used before set
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: device-mapper-multipath
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Alasdair Kergon
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-09 14:14 UTC by David Binderman
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2005-04-21 16:27:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description David Binderman 2005-03-09 14:14:27 UTC
Description of problem:

I just tried to compile device-mapper-multipath-0.4.2-1.0 from Redhat
Fedora Core development tree with the Intel C compiler.

The compiler said

main.c(650): remark #592: variable "mode" is used before its value is set

The source code is

                if (mkdir(CALLOUT_DIR, mode) < 0) {

Suggest init local variable mode before first use.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Christophe Varoqui 2005-03-29 22:50:33 UTC
is the following enough to calm ICC ?

@@ -682,7 +511,7 @@
 static int
 prepare_namespace(void)
 {
-       mode_t mode;
+       mode_t mode = S_IRWXU;
        struct stat *buf;
        char ramfs_args[64];
        int i;


Comment 2 David Binderman 2005-03-30 09:36:09 UTC
>is the following enough to calm ICC ?

I haven't tested it, but a visual inspection suggests it will.

Comment 3 Lars Marowsky-Bree 2005-04-21 11:08:47 UTC
This is fixed in 0.4.3 and up. Can this bug be resolved now?


Note You need to log in before you can comment on or make changes to this bug.