This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: strverscmp for libiberty


> It's a GNU extension.  At this time there's no other user than GCC,  
> but there might be other users in the future.  Should I just put it  
> in GCC?  It would still need to be a separate file; I guess I would  
> call the function gcc_strverscmp so as not to conflict with glibc.

Normally we wait until more than one project uses a given function,
but as this is something that GNU systems will normally have, that's
an argument for putting it in libiberty.  Ian?  Thoughts?

> > Also, the file doesn't quite follow FSF coding conventions, and
> > doesn't include libiberty.h or config.h nor use any of the HAVE_*
> > macros.
> 
> I guess it should just include safe-ctype.h.  How doesn't it follow  
> FSF coding conventions?

+int strverscmp (const char *s1, const char *s2)

Function names always start in column 1.  Have you tried running it
through indent?  It's just a couple of whitespace issues, but the
function name one is important.

> > You should also add code to configure.ac to maybe set the HAVE_DECL_*
> > macro for libiberty's own use.
> 
> OK, although libiberty does not in fact use it and is not likely to.

strverscmp should include libiberty.h, and so making sure it's set
right (else the compile fails).  It's more of a consistency check than
a true need.


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