Bug 164939

Summary: [PATCH] add a standards section to err.3
Product: Documentation Reporter: Niclas Zeising <zeising>
Component: Books & ArticlesAssignee: Eitan Adler <eadler>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
lib.libc.gen.err.3.diff none

Description Niclas Zeising 2012-02-09 20:00:23 UTC
	The err() and warn() family of functions are part of our libc, but not part of the ISO C99 standard.

Fix: The attached patch adds a STANDARDS section to err.3 mentioning that these functions are not part of the ISO C99 standard, and truly portable code should avoid using them.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2012-02-09 20:54:31 UTC
Responsible Changed
From-To: freebsd-doc->eadler

I'll take it.
Comment 2 Ben Kaduk 2012-02-10 02:13:17 UTC
On Thu, 9 Feb 2012, Niclas Zeising wrote:

>
>> Number:         164939
>> Category:       docs
>> Synopsis:       [PATCH] add a standards section to err.3
>> Confidential:   no
>> Severity:       non-critical
>> Priority:       low
>> Responsible:    freebsd-doc
>> State:          open
>> Quarter:
>> Keywords:
>> Date-Required:
>> Class:          doc-bug
>> Submitter-Id:   current-users
>> Arrival-Date:   Thu Feb 09 20:00:23 UTC 2012
>> Closed-Date:
>> Last-Modified:
>> Originator:     Niclas Zeising
>> Release:        FreeBSD 9.0-BETA2 amd64
>> Organization:
>> Environment:
> System: FreeBSD vincent.daemonic.se 9.0-BETA2 FreeBSD 9.0-BETA2 #0 r225368: Sat Sep 3 22:13:26 CEST 2011 root@vincent.daemonic.se:/usr/obj/usr/src/sys/VINCENT amd64
>
>
>
>> Description:
> 	The err() and warn() family of functions are part of our libc, but not part of the ISO C99 standard.
>> How-To-Repeat:
>
>> Fix:
>
> 	The attached patch adds a STANDARDS section to err.3 mentioning that these functions are not part of the ISO C99 standard, and truly portable code should avoid using them.
>
> --- lib.libc.gen.err.3.diff begins here ---
> Index: head/lib/libc/gen/err.3
> ===================================================================
> --- head/lib/libc/gen/err.3	(revision 231033)
> +++ head/lib/libc/gen/err.3	(working copy)
> @@ -212,6 +212,17 @@
> .Xr printf 3 ,
> .Xr strerror 3 ,
> .Xr sysexits 3
> +.Sh STANDARDS
> +The
> +.Fn err
> +and
> +.Fn warn
> +functions are extensions and not part of

This should probably be "family of functions" (or even "families of 
functions") as used earlier in the page.
Additionally, some lazy googling makes it seem that these are BSD 
extensions and should perhaps be qualified as such.  (Though apparently 
some linuxen also provide them for compatibility?)

> +.St -isoC-99 .

I think it is probably disingenuous to call out C99; much of libc is 
compliant with, say, POSIX.  I would just say "not part of a standard" or 
"not formally standardized".

-Ben Kaduk

> +As such they should not be used in truly portable code.
> +Use
> +.Fn strerror
> +or similar functions instead.
> .Sh HISTORY
> The
> .Fn err
> --- lib.libc.gen.err.3.diff ends here ---
>
>
>> Release-Note:
>> Audit-Trail:
>> Unformatted:
> _______________________________________________
> freebsd-doc@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-doc
> To unsubscribe, send any mail to "freebsd-doc-unsubscribe@freebsd.org"
>
Comment 3 dfilter service freebsd_committer freebsd_triage 2012-04-26 13:59:17 UTC
Author: eadler
Date: Thu Apr 26 12:59:08 2012
New Revision: 234700
URL: http://svn.freebsd.org/changeset/base/234700

Log:
  Document the standardization status of err* and warn*
  
  PR:		docs/164939
  Submitted by:	Niclas Zeising <zeising@daemonic.se>
  Approved by:	bcr
  MFC after:	3 days

Modified:
  head/lib/libc/gen/err.3

Modified: head/lib/libc/gen/err.3
==============================================================================
--- head/lib/libc/gen/err.3	Thu Apr 26 11:07:15 2012	(r234699)
+++ head/lib/libc/gen/err.3	Thu Apr 26 12:59:08 2012	(r234700)
@@ -28,7 +28,7 @@
 .\"	From: @(#)err.3	8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd March 6, 1999
+.Dd March 29, 2012
 .Dt ERR 3
 .Os
 .Sh NAME
@@ -212,6 +212,16 @@ if (error != 0)
 .Xr printf 3 ,
 .Xr strerror 3 ,
 .Xr sysexits 3
+.Sh STANDARDS
+The
+.Fn err
+and
+.Fn warn
+families of functions are BSD extensions.
+As such they should not be used in truly portable code.
+Use
+.Fn strerror
+or similar functions instead.
 .Sh HISTORY
 The
 .Fn err
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2012-04-26 14:21:19 UTC
State Changed
From-To: open->patched

committed
Comment 5 dfilter service freebsd_committer freebsd_triage 2012-05-03 17:20:03 UTC
Author: eadler
Date: Thu May  3 16:19:41 2012
New Revision: 234963
URL: http://svn.freebsd.org/changeset/base/234963

Log:
  MFC r234714, r234700:
  	Document the standardization status of err* and warn*
  
  PR:		docs/164939
  Approved by:	cperciva (implicit)

Modified:
  stable/9/lib/libc/gen/err.3
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/gen/err.3
==============================================================================
--- stable/9/lib/libc/gen/err.3	Thu May  3 16:09:44 2012	(r234962)
+++ stable/9/lib/libc/gen/err.3	Thu May  3 16:19:41 2012	(r234963)
@@ -28,7 +28,7 @@
 .\"	From: @(#)err.3	8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd March 6, 1999
+.Dd March 29, 2012
 .Dt ERR 3
 .Os
 .Sh NAME
@@ -212,6 +212,18 @@ if (error != 0)
 .Xr printf 3 ,
 .Xr strerror 3 ,
 .Xr sysexits 3
+.Sh STANDARDS
+The
+.Fn err
+and
+.Fn warn
+families of functions are
+.Bx
+extensions.
+As such they should not be used in truly portable code.
+Use
+.Fn strerror
+or similar functions instead.
 .Sh HISTORY
 The
 .Fn err
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 6 dfilter service freebsd_committer freebsd_triage 2012-05-03 17:21:05 UTC
Author: eadler
Date: Thu May  3 16:20:50 2012
New Revision: 234964
URL: http://svn.freebsd.org/changeset/base/234964

Log:
  MFC r234714, r234700:
  	Document the standardization status of err* and warn*
  
  PR:		docs/164939
  Approved by:	cperciva (implicit)

Modified:
  stable/8/lib/libc/gen/err.3
Directory Properties:
  stable/8/lib/libc/   (props changed)

Modified: stable/8/lib/libc/gen/err.3
==============================================================================
--- stable/8/lib/libc/gen/err.3	Thu May  3 16:19:41 2012	(r234963)
+++ stable/8/lib/libc/gen/err.3	Thu May  3 16:20:50 2012	(r234964)
@@ -28,7 +28,7 @@
 .\"	From: @(#)err.3	8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd March 6, 1999
+.Dd March 29, 2012
 .Dt ERR 3
 .Os
 .Sh NAME
@@ -212,6 +212,18 @@ if (error != 0)
 .Xr printf 3 ,
 .Xr strerror 3 ,
 .Xr sysexits 3
+.Sh STANDARDS
+The
+.Fn err
+and
+.Fn warn
+families of functions are
+.Bx
+extensions.
+As such they should not be used in truly portable code.
+Use
+.Fn strerror
+or similar functions instead.
 .Sh HISTORY
 The
 .Fn err
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 7 dfilter service freebsd_committer freebsd_triage 2012-05-03 17:21:35 UTC
Author: eadler
Date: Thu May  3 16:21:26 2012
New Revision: 234965
URL: http://svn.freebsd.org/changeset/base/234965

Log:
  MFC r234714, r234700:
  	Document the standardization status of err* and warn*
  
  PR:		docs/164939
  Approved by:	cperciva (implicit)

Modified:
  stable/7/lib/libc/gen/err.3
Directory Properties:
  stable/7/lib/libc/   (props changed)

Modified: stable/7/lib/libc/gen/err.3
==============================================================================
--- stable/7/lib/libc/gen/err.3	Thu May  3 16:20:50 2012	(r234964)
+++ stable/7/lib/libc/gen/err.3	Thu May  3 16:21:26 2012	(r234965)
@@ -28,7 +28,7 @@
 .\"	From: @(#)err.3	8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd March 6, 1999
+.Dd March 29, 2012
 .Dt ERR 3
 .Os
 .Sh NAME
@@ -211,6 +211,18 @@ if (error != 0)
 .Xr printf 3 ,
 .Xr strerror 3 ,
 .Xr sysexits 3
+.Sh STANDARDS
+The
+.Fn err
+and
+.Fn warn
+families of functions are
+.Bx
+extensions.
+As such they should not be used in truly portable code.
+Use
+.Fn strerror
+or similar functions instead.
 .Sh HISTORY
 The
 .Fn err
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 8 Eitan Adler freebsd_committer freebsd_triage 2012-05-03 17:51:52 UTC
State Changed
From-To: patched->closed

Committed. Thanks!