Closed su-v closed 10 years ago
Does stdlib.h provide the malloc function on OS X? If so, I'll take extra care to make sure this is handled correctly in the future.
I guess the
while (read = getline (&line, &line_len, file) != -1)warning can be resolved by not using this shorthand syntax.
I'll change that and provide the fix.
Could you try again and see if the warnings/errors are resolved now?
AFAICT all resolved now - no more warnings with 3f3c82081db89de99676038f8bd7ab2fc039488f:
$ git status
# On branch master
nothing to commit (working directory clean)
$ git pull
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 18 (delta 4), reused 0 (delta 0)
Unpacking objects: 100% (18/18), done.
From https://github.com/roelj/inklingreader
5a16b6e..3f3c820 master -> origin/master
Updating 5a16b6e..3f3c820
Fast-forward
src/converters/svg.c | 217 ++++++++++++++++++++++-----------------------
src/gui/mainwindow.c | 2 +
src/high/configuration.c | 2 +-
src/main.c | 1 -
src/parsers/wpi.c | 20 ++--
5 files changed, 119 insertions(+), 123 deletions(-)
$ touch AUTHORS NEWS
$ autoreconf -i
$ CC=CLANG ./configure --prefix=$HOME/.local
checking for a BSD-compatible install... /Volumes/magenta/mp-trunk/quartz/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /Volumes/magenta/mp-trunk/quartz/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... CLANG
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether CLANG accepts -g... yes
checking for CLANG option to accept ISO C89... none needed
checking whether CLANG understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of CLANG... gcc3
checking for pkg-config... /Volumes/magenta/mp-trunk/quartz/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for INKLINGREADER... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
$ make
CC src/main.o
CC src/gui/mainwindow.o
CC src/gui/mainwindow_sig.o
CC src/converters/svg.o
CC src/converters/png.o
CC src/converters/json.o
CC src/converters/pdf.o
CC src/parsers/wpi.o
CC src/high/conversion.o
CC src/high/configuration.o
CCLD inklingreader
$ ./inklingreader --version
Version: 0.6
$
That looks really clean. Thank you for reporting the issues and providing a solution for the malloc.h replacement with stdlib.h.
When compiling current master (@5a16b6e14a5445de597f5a1f8d02e91186f48cdf) on OS X 10.7.5 with clang (based on LLVM 3.1svn), there's still a warning related to malloc:
This diff makes the warning go away (same was used in other places where 'malloc.h' is included):
and another (new) warning later on:
Note: I used this sequence of commands, with an otherwise unmodified checkout of master: