[ROOT] compiler warning

From: cstrato (cstrato@aon.at)
Date: Sun Jun 06 2004 - 19:31:11 MEST

Dear Rooters

I apologize for a simple non-root question, but sorrowly I have
nobody else to ask:
Sometimes I have statements such as the following:
    if (strcmp(name, "option") == 0) {
       char *option;
       option = strcpy(option, opt);

Although it is correct, I get the following compiler warning:
"warning: `char*option' might be used uninitialized in this function"

How can I prevent such compiler warnings?
Would it be save to write:
       char *option = "";
(If this is not save, why?)

Thank you in advance
Best regards
C.h.r.i.s.t.i.a.n. .S.t.r.a.t.o.w.a
V.i.e.n.n.a.         .A.u.s.t.r.i.a

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET