* autconf bcopy and bzero
@ 2008-01-26 18:33 Dan Nicolaescu
2008-01-26 18:54 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Dan Nicolaescu @ 2008-01-26 18:33 UTC (permalink / raw)
To: emacs-devel
uclibc uses #define to define bcopy and bzero in <strings.h>
emacs' configure script decides that bcopy and bzero are not available
and then #defines them in config.h.
Then all the files get warnings like this:
In file included from frame.c:22:
./config.h:1159:1: warning: "bcopy" redefined
In file included from ./config.h:1096,
from frame.c:22:
/usr/include/string.h:329:1: warning: this is the location of the
previous definition
In file included from frame.c:22:
./config.h:1162:1: warning: "bzero" redefined
In file included from ./config.h:1096,
from frame.c:22:
/usr/include/string.h:330:1: warning: this is the location of the
previous definition
Can somebody that understands the autoconf magic involved please fix
this? Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: autconf bcopy and bzero
2008-01-26 18:33 autconf bcopy and bzero Dan Nicolaescu
@ 2008-01-26 18:54 ` Tom Tromey
2008-01-26 19:53 ` autoconf " Dan Nicolaescu
0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2008-01-26 18:54 UTC (permalink / raw)
To: Dan Nicolaescu; +Cc: emacs-devel
>>>>> "Dan" == Dan Nicolaescu <dann@ics.uci.edu> writes:
Dan> uclibc uses #define to define bcopy and bzero in <strings.h>
Dan> emacs' configure script decides that bcopy and bzero are not available
Dan> and then #defines them in config.h.
Can you look in your config.log to see why the existing bcopy test
failed? I think it should work ok.
Dan> In file included from frame.c:22:
Dan> ./config.h:1159:1: warning: "bcopy" redefined
Dan> In file included from ./config.h:1096,
Dan> from frame.c:22:
Dan> /usr/include/string.h:329:1: warning: this is the location of the
Dan> previous definition
One way to get rid of the warning is to '#undef bcopy' before defining
it. Alternatively, the code could read:
#if !defined HAVE_BCOPY && !defined bcopy
#define bcopy(a,b,s) memcpy (b,a,s)
#endif
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: autoconf bcopy and bzero
2008-01-26 19:53 ` autoconf " Dan Nicolaescu
@ 2008-01-26 19:23 ` Tom Tromey
0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2008-01-26 19:23 UTC (permalink / raw)
To: Dan Nicolaescu; +Cc: emacs-devel
>> One way to get rid of the warning is to '#undef bcopy' before defining
>> it. Alternatively, the code could read:
>>
>> #if !defined HAVE_BCOPY && !defined bcopy
>> #define bcopy(a,b,s) memcpy (b,a,s)
>> #endif
Dan> That's the obvious think to do, but is it correct?
I don't think there is a really correct answer. IMO these can't hurt,
and they should always give a working result. For things I maintain,
that would be good enough; I don't know what the Emacs approach is
here.
Using bcopy et al is a bit funny. Most other projects I follow moved
to the mem* functions years ago. This is very minor, though, I
suppose.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: autoconf bcopy and bzero
2008-01-26 18:54 ` Tom Tromey
@ 2008-01-26 19:53 ` Dan Nicolaescu
2008-01-26 19:23 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Dan Nicolaescu @ 2008-01-26 19:53 UTC (permalink / raw)
To: Tom Tromey; +Cc: emacs-devel
Tom Tromey <tromey@redhat.com> writes:
> >>>>> "Dan" == Dan Nicolaescu <dann@ics.uci.edu> writes:
>
> Dan> uclibc uses #define to define bcopy and bzero in <strings.h>
> Dan> emacs' configure script decides that bcopy and bzero are not available
> Dan> and then #defines them in config.h.
>
> Can you look in your config.log to see why the existing bcopy test
> failed? I think it should work ok.
The autoconf test does not include <strings.h>, so it can't see
definitions for bzero/bcopy.
config.h does include <strings.h>
> Dan> In file included from frame.c:22:
> Dan> ./config.h:1159:1: warning: "bcopy" redefined
> Dan> In file included from ./config.h:1096,
> Dan> from frame.c:22:
> Dan> /usr/include/string.h:329:1: warning: this is the location of the
> Dan> previous definition
>
> One way to get rid of the warning is to '#undef bcopy' before defining
> it. Alternatively, the code could read:
>
> #if !defined HAVE_BCOPY && !defined bcopy
> #define bcopy(a,b,s) memcpy (b,a,s)
> #endif
That's the obvious think to do, but is it correct?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-01-26 19:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-26 18:33 autconf bcopy and bzero Dan Nicolaescu
2008-01-26 18:54 ` Tom Tromey
2008-01-26 19:53 ` autoconf " Dan Nicolaescu
2008-01-26 19:23 ` Tom Tromey
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.