diff options
author | Reinhold Kainhofer <reinhold@kainhofer.com> | 2011-08-07 19:13:04 +0200 |
---|---|---|
committer | Reinhold Kainhofer <reinhold@kainhofer.com> | 2011-08-14 16:30:16 +0200 |
commit | 638ad29c79717fc1ba895b14aee256dd3a03f25b (patch) | |
tree | 4a93afefaeafd70ed8ad528fa4fb84fdf6177d85 /flower | |
parent | 1d142bf5ed6b0df3b9f54cf65005c8ba31d219e6 (diff) |
Get rid of some compiler warnings; Fix chdir handling of errors
-) Some "unused parameter" warnings
-) Some "ignoring return value" are a bit trickier. They are bad coding style:
o) the file-name.cc one returns a string with undefined contents if getcwd
fails, which might either crash guile or lead to other bugs.
o) the lily-parser-scheme.cc warning was also a programming error (if you
used --output=dir/file, and dir/ had the wrong permissions, then
lilypond would not print an error, but simply put the output file into
the current directory without telling the user!).
In this case (output dir explicitly requested, but not possible
to change there), I think it's best to exit lilypond with an
error.
-) signed/unsigned warning in glissando-engraver.cc, where we already
had a check for negative values, so explicitly casting to unsigned
shuts up the compiler.
-) Remove unneccessary #(set-paper-size "a6") in the regtests
-) fix bad texinfo code in function documentation
Diffstat (limited to 'flower')
-rw-r--r-- | flower/file-name.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/flower/file-name.cc b/flower/file-name.cc index 14812a034c..27ce6df6f8 100644 --- a/flower/file-name.cc +++ b/flower/file-name.cc @@ -97,9 +97,8 @@ string get_working_directory () { char cwd[PATH_MAX]; - getcwd (cwd, PATH_MAX); - - return string (cwd); + // getcwd returns NULL upon a failure, contents of cwd would be undefined! + return string (getcwd (cwd, PATH_MAX)); } /* Join components to full file_name. */ |