* [BUG] imap-send.c fails to build on OSX
@ 2006-03-12 14:44 Randal L. Schwartz
2006-03-12 19:08 ` Randal L. Schwartz
2006-03-13 4:25 ` Shawn Pearce
0 siblings, 2 replies; 5+ messages in thread
From: Randal L. Schwartz @ 2006-03-12 14:44 UTC (permalink / raw)
To: git
gcc -o imap-send.o -c -g -O2 -Wall -I/sw/include -I/opt/local/include -DSHA1_HEADER='<openssl/sha.h>' imap-send.c
imap-send.c:376: error: static declaration of 'vasprintf' follows non-static declaration
/usr/include/stdio.h:297: error: previous declaration of 'vasprintf' was here
make: *** [imap-send.o] Error 1
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [BUG] imap-send.c fails to build on OSX
2006-03-12 14:44 [BUG] imap-send.c fails to build on OSX Randal L. Schwartz
@ 2006-03-12 19:08 ` Randal L. Schwartz
2006-03-13 4:25 ` Shawn Pearce
1 sibling, 0 replies; 5+ messages in thread
From: Randal L. Schwartz @ 2006-03-12 19:08 UTC (permalink / raw)
To: git
>>>>> "Randal" == Randal L Schwartz <merlyn@stonehenge.com> writes:
Randal> gcc -o imap-send.o -c -g -O2 -Wall -I/sw/include -I/opt/local/include -DSHA1_HEADER='<openssl/sha.h>' imap-send.c
Randal> imap-send.c:376: error: static declaration of 'vasprintf' follows non-static declaration
Randal> /usr/include/stdio.h:297: error: previous declaration of 'vasprintf' was here
Randal> make: *** [imap-send.o] Error 1
By the way, /usr/include/stdio.h near the line in question looks like:
int vasprintf(char **, const char *, va_list) __DARWIN_LDBL_COMPAT(vasprintf);
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [BUG] imap-send.c fails to build on OSX
2006-03-12 14:44 [BUG] imap-send.c fails to build on OSX Randal L. Schwartz
2006-03-12 19:08 ` Randal L. Schwartz
@ 2006-03-13 4:25 ` Shawn Pearce
2006-03-13 4:29 ` Randal L. Schwartz
1 sibling, 1 reply; 5+ messages in thread
From: Shawn Pearce @ 2006-03-13 4:25 UTC (permalink / raw)
To: Randal L. Schwartz; +Cc: git
Workarounds for compiling on MacOS X.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
"Randal L. Schwartz" <merlyn@stonehenge.com> wrote:
>
> gcc -o imap-send.o -c -g -O2 -Wall -I/sw/include -I/opt/local/include -DSHA1_HEADER='<openssl/sha.h>' imap-send.c
> imap-send.c:376: error: static declaration of 'vasprintf' follows non-static declaration
> /usr/include/stdio.h:297: error: previous declaration of 'vasprintf' was here
> make: *** [imap-send.o] Error 1
This should fix the build issues on Mac OS X. Not tested on other
(possibly) more important platforms, like Linux. :-)
generate-cmdlist.sh | 2 +-
imap-send.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
base 57f4a482a7fc31e31cafd31fe23f4a4779b2c2f0
last 6854050e1cdaf1b7ab352e1d4757ff5b29a5db93
diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
index 6ee85d5..76ba49c 100755
--- a/generate-cmdlist.sh
+++ b/generate-cmdlist.sh
@@ -42,7 +42,7 @@ EOF
while read cmd
do
sed -n "/NAME/,/git-$cmd/H;
- \$ {x; s/.*git-$cmd - \\(.*\\)/ {\"$cmd\", \"\1\"},/; p}" \
+ \$ {x; s/.*git-$cmd - \\(.*\\)/ {\"$cmd\", \"\1\"},/; p;}" \
"Documentation/git-$cmd.txt"
done
echo "};"
diff --git a/imap-send.c b/imap-send.c
index fddaac0..376929f 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -370,7 +370,7 @@ free_generic_messages( message_t *msgs )
}
}
-static int
+int
vasprintf( char **strp, const char *fmt, va_list ap )
{
int len;
--
1.2.4.g806b
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [BUG] imap-send.c fails to build on OSX
2006-03-13 4:25 ` Shawn Pearce
@ 2006-03-13 4:29 ` Randal L. Schwartz
2006-03-13 5:03 ` Shawn Pearce
0 siblings, 1 reply; 5+ messages in thread
From: Randal L. Schwartz @ 2006-03-13 4:29 UTC (permalink / raw)
To: Shawn Pearce; +Cc: git
>>>>> "Shawn" == Shawn Pearce <spearce@spearce.org> writes:
Shawn> Workarounds for compiling on MacOS X.
Shawn> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn> This should fix the build issues on Mac OS X. Not tested on other
Shawn> (possibly) more important platforms, like Linux. :-)
My C is a bit rusty, but wouldn't that provide a definition for vasprintf when
the libc is *also* providing a definition? Might that not also break other
apps that want to link with this?
Maybe the right solution is to rename this local implementation so that it
can't conflict, like "git_vasprintf", or to include it only when the libc
doesn't provide it.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [BUG] imap-send.c fails to build on OSX
2006-03-13 4:29 ` Randal L. Schwartz
@ 2006-03-13 5:03 ` Shawn Pearce
0 siblings, 0 replies; 5+ messages in thread
From: Shawn Pearce @ 2006-03-13 5:03 UTC (permalink / raw)
To: Randal L. Schwartz; +Cc: git
"Randal L. Schwartz" <merlyn@stonehenge.com> wrote:
> >>>>> "Shawn" == Shawn Pearce <spearce@spearce.org> writes:
>
> Shawn> Workarounds for compiling on MacOS X.
> Shawn> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
>
> Shawn> This should fix the build issues on Mac OS X. Not tested on other
> Shawn> (possibly) more important platforms, like Linux. :-)
>
> My C is a bit rusty, but wouldn't that provide a definition for vasprintf when
> the libc is *also* providing a definition? Might that not also break other
> apps that want to link with this?
>
> Maybe the right solution is to rename this local implementation so that it
> can't conflict, like "git_vasprintf", or to include it only when the libc
> doesn't provide it.
Your right. But I figured it wasn't a big deal since this is just
an application and not library code. Nobody should be linking
against it.
Perhaps the better solution is to rename the provided implementation
to git_; maybe even better to move it off to the compat library
area where other should-have-been-provided-by-the-OS definitions are.
--
Shawn.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-03-13 5:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-12 14:44 [BUG] imap-send.c fails to build on OSX Randal L. Schwartz
2006-03-12 19:08 ` Randal L. Schwartz
2006-03-13 4:25 ` Shawn Pearce
2006-03-13 4:29 ` Randal L. Schwartz
2006-03-13 5:03 ` Shawn Pearce
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).