lostsoul said:

but haven't found any problems jet with additionaly using the pragma:
no warnings 'uninitialized';

Perhaps I am being a bit too old fashioned and conservative here; but If I saw that in a code review, I'd issue an immediate "Reject -- Unsafe Coding Practice; Not Allowed In Production" defect and terminate the review right then and there.

The 'initialized variable' warning is an indicator to me that the Coder either: a) doesn't understand the logic because He (and almost all ways it's a male) couldn't figure out what the proper starting value should be, or b) is too lazy to add the three or four more characters needed to ensure that the subsequent code has a sound starting place. Turning any warning off is an immediate red-flag.

This is another example of "Just because you CAN do something doesn't mean that you SHOULD do it." In the forty plus years I have been playing at this Game, I have been bitten by the initialized-variable problem far too often; I can't think of one occasion when I couldn't define the proper starting conditions for my variables.

Note: I started my career on machines that did not 'zero-core' before loading a new program. If you didn't initialize your variables, they started with what ever bit-trash was lying in the patch of memory they were assigned. I spent the entire summer in my Junior year debugging a C compiler that Bell Labs had "ported" to the S/360 (an IBM mainframe Operating System), because of the tacit assumption that all numerical variables (either init, float, or double) would contain x'00' as their initial value. I come by my bias honestly. And yes, I finally ran down all of the for loops (both the explicit ones and all the implicit loops); but it took three long months of debugging some 'really clever code' in a language that I had only just been exposed to. ("Hey, weren't you read K&R just last month? Here is the problem we have and you're just the lad to sort it out.")

----
I Go Back to Sleep, Now.

OGB


In reply to Re^2: Use of uninitialized value by Old_Gray_Bear
in thread Use of uninitialized value by Angharad

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.