This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Warning Building Newlib Head


On 1/14/2015 10:12 AM, Corinna Vinschen wrote:
> Hi Joel,
>
> On Jan 14 09:56, Joel Sherrill wrote:
>> Hi
>>
>> Looking at the warnings in the build logs, I saw this:
>>
>> newlib/libc/posix/glob.c:383:7: warning: implicit declaration of
>> function 'issetugid' [-Wimplicit-function-declaration]
>>
>> I was going to add an include to eliminate this but don't see one. The
>> method
>> is referenced in these files:
>>
>> $ grep -r issetugid .
>> ./posix/glob.c:            issetugid() != 0 ||
>> ./sys/rtems/crt0.c:RTEMS_STUB(int, issetugid (void), { return 0; })
>> ./sys/linux/net/issetugid-stub.c:issetugid(void)
>>
>> Where should this method be prototyped?
> Per the BSDs, in unistd.h, ideally with an #if __BSD_VISIBLE.
>
> OTOH, none of our targets actually provides this function, so it
> might be better to add the prototype to glob.c itself?
>
RTEMS actually has this but the source is in our "libcsupport/"
directory.  :)

Does that make Craig's suggestion to add it to unistd.h with __BSD_VISIBLE
seem OK?

This seems to resolve the warning:

diff --git a/newlib/libc/include/sys/unistd.h
b/newlib/libc/include/sys/unistd.h
index a741383..53883f2 100644
--- a/newlib/libc/include/sys/unistd.h
+++ b/newlib/libc/include/sys/unistd.h
@@ -117,6 +117,9 @@ char *  _EXFUN(getwd, (char *__buf ));
 int    _EXFUN(iruserok, (unsigned long raddr, int superuser, const char
*ruser,
 #endif
 int     _EXFUN(isatty, (int __fildes ));
+#if __BSD_VISIBLE
+int    _EXFUN(issetugid, (void));
+#endif
 #if !defined(__INSIDE_CYGWIN__)
 int     _EXFUN(lchown, (const char *__path, uid_t __owner, gid_t
__group ));
 #endif

> Corinna
>

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]