Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2016 13:03:55 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r306100 - head/include
Message-ID:  <201609211303.u8LD3tQV058276@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Wed Sep 21 13:03:55 2016
New Revision: 306100
URL: https://svnweb.freebsd.org/changeset/base/306100

Log:
  Refine the dirname(3) compatibility workaround a bit more.
  
  Right now our workaround is so good that it doesn't throw any warnings
  on misuse. This means that people will keep on using the old version
  of dirname(3) silently without fixing their code.
  
  Go ahead and change the prototype of __old_dirname() to also use a plain
  char *, so that we still get a compiler warning. This won't have any
  negative effect on building older versions of FreeBSD on HEAD, as those
  are built with -Werror disabled.
  
  Differential Revision:	https://reviews.freebsd.org/D7844

Modified:
  head/include/libgen.h

Modified: head/include/libgen.h
==============================================================================
--- head/include/libgen.h	Wed Sep 21 13:02:43 2016	(r306099)
+++ head/include/libgen.h	Wed Sep 21 13:03:55 2016	(r306100)
@@ -48,11 +48,11 @@ __END_DECLS
  *
  * Apply a workaround where we explicitly link against dirname@FBSD_1.0
  * in case this function is called on constant strings, instead of
- * making the build fail.
+ * making the program crash at runtime.
  */
 #if defined(__generic) && !defined(__cplusplus)
 __BEGIN_DECLS
-char	*__old_dirname(const char *);
+char	*__old_dirname(char *);
 __END_DECLS
 __sym_compat(dirname, __old_dirname, FBSD_1.0);
 #define	dirname(x)	__generic(x, const char *, __old_dirname, dirname)(x)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609211303.u8LD3tQV058276>