matricks / bam

Bam is a fast and flexible build system. Bam uses Lua to describe the build process. It's takes its inspiration for the script files from scons. While scons focuses on being 100% correct when building, bam makes a few sacrifices to acquire fast full and incremental build times.
http://matricks.github.com/bam
Other
146 stars 47 forks source link

compiler warning on macOS #133

Closed jxsl13 closed 5 years ago

jxsl13 commented 5 years ago
compiling using gcc...
src/dep_cpp.c:344:2: warning: no newline at end of file [-Wnewline-eof]
}
 ^
1 warning generated.
src/support.c:367:7: warning: variable 'isdir' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                        if(!have_d_type) {
                           ^~~~~~~~~~~~
src/support.c:374:36: note: uninitialized use occurs here
                        callback(buffer, entry->d_name, isdir, user);
                                                        ^~~~~
src/support.c:367:4: note: remove the 'if' if its condition is always true
                        if(!have_d_type) {
                        ^~~~~~~~~~~~~~~~~
src/support.c:355:13: note: initialize the variable 'isdir' to silence this warning
                        int isdir;
                                 ^
                                  = 0
1 warning generated.
matricks commented 5 years ago

It's a false positive but I've rewritten it to be cleaner as well. Fixed in 68777f2c1ebcd7cdbf788fca2b0dcb8816d79a2d