Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler: -Wundefined to warn about undefined variables (WIP)
Limitations: - complains about iterative calculations like avg = A*avg+(1-A)*VALUE - no way to explicitly initialize variables to zero (making the warning go away)
- Loading branch information
Showing
6 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
. ./Common | ||
|
||
############################################################################### | ||
|
||
ptest "-Wundefined: variable defined per-frame" -q -Wundefined <<EOF | ||
per_frame: | ||
foo = 1 | ||
bar = foo | ||
per_vertex: | ||
bar = foo | ||
EOF | ||
expect <<EOF | ||
EOF | ||
|
||
#------------------------------------------------------------------------------ | ||
|
||
ptest "-Wundefined: variable defined per-vertex" -q -Wundefined <<EOF | ||
per_vertex: | ||
foo = 1 | ||
bar = foo | ||
EOF | ||
expect <<EOF | ||
EOF | ||
|
||
#------------------------------------------------------------------------------ | ||
|
||
ptest "-Wundefined: variable undefined in per-frame" -q -Wundefined <<EOF | ||
per_frame: | ||
bar = foo | ||
EOF | ||
expect <<EOF | ||
accessing undefined variable foo | ||
EOF | ||
|
||
#------------------------------------------------------------------------------ | ||
|
||
ptest "-Wundefined: variable undefined in per-vertex" -q -Wundefined <<EOF | ||
per_vertex: | ||
bar = foo | ||
EOF | ||
expect <<EOF | ||
accessing undefined variable foo | ||
EOF | ||
|
||
############################################################################### |