php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15914 *lots* of compiler warnings...
Submitted: 2002-03-06 15:42 UTC Modified: 2002-06-18 06:35 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: temp201 at hotmail dot com Assigned:
Status: Not a bug Package: Compile Warning
PHP Version: 4.1.2 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: temp201 at hotmail dot com
New email:
PHP Version: OS:

 

 [2002-03-06 15:42 UTC] temp201 at hotmail dot com
Compiler warnings ?
You mean you want to see compiler warnings ?

Well if youv'e got gcc, try compiling with
-Wall -Wshadow -Wpointer-arith -Wcast-qual -W


Just to give a few serious examples here:

cast discards qualifiers from pointer target type
comparison between signed and unsigned
comparison of unsigned expression < 0 is always false
signed and unsigned type in conditional expression
declaration of `foo' shadows previous local
declaration of `foo' shadows global declaration
`foo' defined but not used
implicit declaration of function `foo'
left-hand operand of comma expression has no effect
missing initializer
passing arg 1 of `foo' discards qualifiers from pointer target type
`foo' declared `bar' but never defined
`register' is not at beginning of declaration
statement with no effect
`static' is not at beginning of declaration
unused parameter `foo'


Mind you, some of these, like "comparison between signed and unsigned" or "signed and unsigned type in conditional expression" are even considered FATAL or ILLEGAL by some compilers, instead of 'just' warnings...


May I even dare suggest the developers (the ones using gcc at least) include the following:

CFLAGS="-Wall -Wshadow -Wpointer-arith -Wcast-qual -W"
CPPFLAGS="-Wall -Wshadow -Wpointer-arith -Wcast-qual -W"
export CFLAGS CPPFLAGS

to their .profiles ?

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Nov 25 20:01:23 2020 UTC