Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diagnostics misses things #399

Closed
p5pRT opened this issue Aug 19, 1999 · 3 comments
Closed

diagnostics misses things #399

p5pRT opened this issue Aug 19, 1999 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 19, 1999

Migrated from rt.perl.org#1234 (status was 'resolved')

Searchable as RT1234$

@p5pRT
Copy link
Author

p5pRT commented Aug 19, 1999

From tchrist@jhereg.perl.com

% perl -Mdiagnostics -we 'print $x[-1]'
Name "main​::x" used only once​: possible typo at -e line 1.
Use of uninitialized value at -e line 1 (#1)
 
  (W) An undefined value was used as if it were already defined. It was
  interpreted as a "" or a 0, but maybe it was a mistake. To suppress this
  warning assign an initial value to your variables.
 
[Exit 0]

Something is strange there. It looks like a couple of diags didn't
make it. Any ideas?

--tom

@p5pRT
Copy link
Author

p5pRT commented Aug 19, 1999

From [Unknown Contact. See original ticket]

Tom Christiansen writes​:

% perl -Mdiagnostics -we 'print "fred"/0'
Argument "fred" isn't numeric in divide at -e line 1 (#1)
Argument "fred" isn't numeric in divide at -e line 1.
Illegal division by zero at -e line 1 (#2)

\(F\) You tried to divide a number by 0\.  Either something was wrong in your
logic\, or you need to put a conditional in to guard against meaningless input\.

Uncaught exception from user code​:
Illegal division by zero at -e line 1.
[Exit 2]

% perl -Mdiagnostics -we 'print $x[-1]'
Name "main​::x" used only once​: possible typo at -e line 1.
Use of uninitialized value at -e line 1 (#1)

\(W\) An undefined value was used as if it were already defined\.  It was
interpreted as a "" or a 0\, but maybe it was a mistake\.  To suppress this
warning assign an initial value to your variables\.

[Exit 0]

Something is strange there. It looks like a couple of diags didn't
make it. Any ideas?

Most compile-time messages are warnings (by obvious reasons - they are
not fatal - compiler looks forwards for more errors). Probably
diagnostics should set __WARN__ handler which checks $^S. (sp?)

Ilya

@p5pRT
Copy link
Author

p5pRT commented Aug 19, 1999

From [Unknown Contact. See original ticket]

Most compile-time messages are warnings (by obvious reasons - they are
not fatal - compiler looks forwards for more errors). Probably
diagnostics should set __WARN__ handler which checks $^S. (sp?)

I keep hoping Larry will follow through on his musings of
deprecating that whole mess.

--tom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant