|  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
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
37 - 31 = ?
Subscribe to this entry?

 [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"

to their .profiles ?


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Sep 25 14:01:25 2023 UTC