<?xml version="1.0" encoding="utf-8"?>
<!--  RSS generated by Flaimo.com RSS Builder [2012-02-05 23:33:01]  --> <rss version="2.0" xmlns:im="http://purl.org/rss/1.0/item-images/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" >
<channel>
<docs>http://www.austingroupbugs.net/</docs>
<description>Austin Group Defect Tracker - ISSUES</description>
<link>http://www.austingroupbugs.net/</link>
<title>Austin Group Defect Tracker - ISSUES</title>
<image>
<title>Austin Group Defect Tracker - ISSUES</title>
<url>http://www.austingroupbugs.net/images/mantis_logo_button.gif</url>
<link>http://www.austingroupbugs.net/</link>
<description>Austin Group Defect Tracker - ISSUES</description>
</image>
<category>All Projects</category>
<ttl>10</ttl>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<sy:updateBase>2012-02-05T23:33:01+00:00</sy:updateBase>
<item>
<title>0000540: Add API for adding entries to user accounting database by passing a pseudo-terminal master file descriptor</title>
<link>http://www.austingroupbugs.net/view.php?id=540</link>
<description>There are libraries out there, such as `libutempter' that can be used to update utmp(x) entries without any root-like privileges, by passing the file descriptor to a pseudo-terminal master device. These libraries  typically spawn a setuid binary to perform the update to the database.&lt;br /&gt;
&lt;br /&gt;
It would be nice if POSIX were to integrate such a feature. Currently there is quite some inconsistency in current implementations whether or not they work without any additional privileges. In (almost) all cases, these unprivileged applications are only interested in managing entries for pseudo-terminals.</description>
<guid>http://www.austingroupbugs.net/view.php?id=540</guid>
<author>EdSchouten &lt;EdSchouten@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=540#bugnotes</comments>
</item>
<item>
<title>0000529: fildes unspecified on close()'s [EINTR]</title>
<link>http://www.austingroupbugs.net/view.php?id=529</link>
<description>The standard currently reads&lt;br /&gt;
&lt;br /&gt;
If close() is interrupted by a signal that is to be caught, it shall return -1 with errno set to [EINTR] and the state of fildes is unspecified.&lt;br /&gt;
&lt;br /&gt;
If a signal occurs and we reissue close(), we might get an [EBADF]. Worse, if a different thread opens a file at the wrong time and gets our file descriptor, we might end up closing the wrong file.</description>
<guid>http://www.austingroupbugs.net/view.php?id=529</guid>
<author>Love4Boobies &lt;Love4Boobies@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=529#bugnotes</comments>
</item>
<item>
<title>0000538: Missing part of basename changes from bug 192</title>
<link>http://www.austingroupbugs.net/view.php?id=538</link>
<description>When applying the TC1 changes to the SUSv4 source, the editors noticed&lt;br /&gt;
that part of the changes from bug &lt;a href=&quot;http://www.austingroupbugs.net/view.php?id=192&quot;&gt;0000192&lt;/a&gt; (the change to the RATIONALE&lt;br /&gt;
section) were overlooked when it was split into separate changes.&lt;br /&gt;
&lt;br /&gt;
A correction will be made in the next draft of TC1, but since this is&lt;br /&gt;
not a simple editorial change this bug is being submitted to record the&lt;br /&gt;
change.  A simple editorial correction to the section name on line 9892&lt;br /&gt;
is also being made at the same time.&lt;br /&gt;
&lt;br /&gt;
At this late stage in the development of TC1 the correction needs to be&lt;br /&gt;
made without altering any of the later change numbers.  Fortunately&lt;br /&gt;
there is a neat way to distribute the full set of changes between the&lt;br /&gt;
existing three change numbers (65, 66, 67).</description>
<guid>http://www.austingroupbugs.net/view.php?id=538</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=538#bugnotes</comments>
</item>
<item>
<title>0000528: Support extended regular expressions (EREs) in sed</title>
<link>http://www.austingroupbugs.net/view.php?id=528</link>
<description>I propose standardizing a flag so sed users can use Extended Regular Expression (EREs) and not just basic regular expressions (BREs), making sed consistent with grep and awk.  I recommend using “-E”, though “-r” is plausible (both are widely implemented).&lt;br /&gt;
&lt;br /&gt;
Here is my rationale:&lt;br /&gt;
&lt;br /&gt;
1. This would make sed consistent with the related POSIX utilities grep (which supports EREs using -E) and awk (which *only* supports EREs).  It is an odd inconsistency that POSIX sed cannot use EREs at all, when related utilities *allow* or *require* EREs.&lt;br /&gt;
&lt;br /&gt;
2. Many matches and substitutions are simpler to express as an ERE than as a BRE, and these are typical uses of sed.  BRE doesn’t include functionality like ERE’s special character | (“or”) at all.  Common BRE expressions like \(, \), \{, and \} are, in ERE, the simpler (, ), {, and }.  BRE doesn’t include the ERE special character + to mean “one or more”; you can simulate it with  &quot;\{1,\}”, and GNU sed includes the extension \+, but EREs include this as a special character because it is such a common need.  This increased functionality and simplification matters.&lt;br /&gt;
&lt;br /&gt;
3. Supporting EREs also makes sed more consistent with the many programming languages that support regular expressions, including Perl and Python.  Most languages with built-in regular expression support either EREs or Perl-like REs (which are a superset of EREs), not BREs.  As a result, far more people are familiar with the ERE syntax than the BRE syntax.&lt;br /&gt;
&lt;br /&gt;
4. Many people consider BREs “obsolete” and that EREs are more “modern”. For example, the FreeBSD sed documentation says that its “-E” flag uses “extended (modern) regular expressions rather than basic regular expressions (BRE's)”, and its documentation for regex(7) describes the REG_EXTENDED flag as “Compile modern (‘extended’) REs, rather than the obsolete (‘basic’) REs”.  The book “Mac OS X UNIX: 101 byte-sized projects”  by Adrian Mayo, page 450, says:  “Unix supports three types of regular expressions... modern (also termed extended), obsolete (also termed basic), and Perl regular expressions...”.  You don’t need to agree that BREs are obsolete, but since many people do believe this, it would be valuable to have a standard way to use their preferred regex format.&lt;br /&gt;
&lt;br /&gt;
5. This capability is widely implemented using the “-E” flag, the “-r” flag, or both:&lt;br /&gt;
* GNU sed supports EREs using either “-r” or “-E”, though it only documents “-r”.  To confirm that it supports “-E”, see its source code at &lt;a href=&quot;http://git.savannah.gnu.org/cgit/sed.git/tree/sed/sed.c&quot;&gt;http://git.savannah.gnu.org/cgit/sed.git/tree/sed/sed.c&lt;/a&gt; [&lt;a href=&quot;http://git.savannah.gnu.org/cgit/sed.git/tree/sed/sed.c&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;] and look for the line containing the comment “Undocumented, for compatibility with BSD sed... case ‘E’: ”).&lt;br /&gt;
*  OpenBSD sed supports EREs using “-E” (and recommends this flag) and “-r” (the “-r” flag is documented as being for portability with GNU sed).  See: &lt;a href=&quot;http://www.openbsd.org/cgi-bin/man.cgi?query=sed&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html&quot;&gt;http://www.openbsd.org/cgi-bin/man.cgi?query=sed&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html.&lt;/a&gt; [&lt;a href=&quot;http://www.openbsd.org/cgi-bin/man.cgi?query=sed&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
* FreeBSD sed has the same situation as OpenBSD; it supports “-E” (and recommends this flag), and it supports “-r” for compatibility with GNU sed.  &lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=sed&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+8.2-RELEASE&amp;arch=default&amp;format=html&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=sed&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+8.2-RELEASE&amp;arch=default&amp;format=html&lt;/a&gt; [&lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=sed&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+8.2-RELEASE&amp;arch=default&amp;format=html&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
* NetBSD sed is the same as OpenBSD; it supports “-E” and “-r”. See: &lt;a href=&quot;http://netbsd.gw.com/cgi-bin/man-cgi?sed++NetBSD-current&quot;&gt;http://netbsd.gw.com/cgi-bin/man-cgi?sed++NetBSD-current&lt;/a&gt; [&lt;a href=&quot;http://netbsd.gw.com/cgi-bin/man-cgi?sed++NetBSD-current&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
* MacOS sed supports only -E for this, and not “-r”: &lt;a href=&quot;http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/sed.1.html&quot;&gt;http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/sed.1.html&lt;/a&gt; [&lt;a href=&quot;http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/sed.1.html&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
&lt;br /&gt;
6. ERE support is trivial to add to existing sed implementations if they don’t already have it.  A sed implementation that doesn’t already implement EREs could simply recognize a flag, and later call regex() using REG_EXTENDED if that flag was present.  Since regex() is already in the standard, this should be trivial to do for any sed implementation that cares about the POSIX standard at all.&lt;br /&gt;
&lt;br /&gt;
7. People really do depend on sed supporting EREs.  For example, in this email: &lt;a href=&quot;http://ghostscript.com/pipermail/gs-bugs/2010-June/014175.html&quot;&gt;http://ghostscript.com/pipermail/gs-bugs/2010-June/014175.html&lt;/a&gt; [&lt;a href=&quot;http://ghostscript.com/pipermail/gs-bugs/2010-June/014175.html&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;] the developers were using sed with EREs, and decided that they would use different flags for different systems instead of trying to use BREs.  They noted that this their approach would fail if sed didn’t support EREs, but that seemed to be of no concern to them.  Which suggests there’s a need to standardize using EREs in sed!&lt;br /&gt;
&lt;br /&gt;
The question is, what flag should be used?  Both “-E” (BSD-style) and “-r” (GNU-style) are in common use.  I recommend that the “-E” (BSD-style) flag be standardized at least, because:&lt;br /&gt;
1. It’s consistent with grep (which already uses the “-E” flag).&lt;br /&gt;
2. The flag letter is more obviously related to “Extended Regular Expressions (EREs)”.&lt;br /&gt;
3. It’s widely supported.  In particular, GNU sed already supports -E, while MacOS (as far as I can tell) doesn’t support “-r”.&lt;br /&gt;
&lt;br /&gt;
A counter-argument is that some people might be confused by upper and lower case flags (‘E’ vs. ‘e’) with such different meanings.  I disagree.  POSIX flags are already case-sensitive; widely-used utilities like “ls” already have lots of flags that differ only by case.  Indeed, the related POSIX utility awk has flags that differ by case (“-F” vs. “-f”).  The symbols “e” and “E” have very different appearance in most fonts, so it’s unlikely that they would be visually confused.&lt;br /&gt;
&lt;br /&gt;
One minor problem is that many non-portable sed scripts already use “-r”, since that is what GNU sed actually documents and originally implemented.  Alternatives include:&lt;br /&gt;
1. Supporting both “-r” and “-E” (as synonyms).  This would have the advantage of making many existing scripts comply with the new specification, without any changes.  It’s also very easy to implement; most implementations could just add a case statement if it’s not there already.&lt;br /&gt;
2. Supporting just “-r” instead of “-E”.  I think “-E” is better, as described above, but this would be fine as well.&lt;br /&gt;
3. Recommending, but not requiring, that implementations support “-r” as a synonym.&lt;br /&gt;
I don’t *really* care what the flag name(s) are, as long as there’s a standard way to access EREs.  &lt;br /&gt;
If people want those instead, the proposal could be easily tweaked to accommodate this.</description>
<guid>http://www.austingroupbugs.net/view.php?id=528</guid>
<author>dwheeler &lt;dwheeler@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=528#bugnotes</comments>
</item>
<item>
<title>0000539: tighten du regarding files encountered through multiple command line arguments</title>
<link>http://www.austingroupbugs.net/view.php?id=539</link>
<description>&lt;a href=&quot;http://www.austingroupbugs.net/view.php?id=527&quot;&gt;0000527&lt;/a&gt; gave a resolution that for TC2 of Issue 7, du would be documented&lt;br /&gt;
as having unspecified behavior if a file is encountered multiple times&lt;br /&gt;
through multiple command line arguments, but also added a future directions&lt;br /&gt;
stating that this may be tightened in the future.  Issue 8 is the perfect&lt;br /&gt;
time to make these additional restrictions binding on implementations.&lt;br /&gt;
&lt;br /&gt;
The desired action is written assuming that &lt;a href=&quot;http://www.austingroupbugs.net/view.php?id=527&quot;&gt;0000527&lt;/a&gt; has already been&lt;br /&gt;
applied, but uses line numbers from Issue 7.</description>
<guid>http://www.austingroupbugs.net/view.php?id=539</guid>
<author>eblake &lt;eblake@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=539#bugnotes</comments>
</item>
<item>
<title>0000527: du and files found via multiple command line arguments</title>
<link>http://www.austingroupbugs.net/view.php?id=527</link>
<description>The standard currently states about du:&lt;br /&gt;
&lt;br /&gt;
[line 84170] Files with multiple links shall be counted and written for&lt;br /&gt;
only one entry. The directory entry that is selected in the report is&lt;br /&gt;
unspecified.&lt;br /&gt;
&lt;br /&gt;
A strict interpretation of the standard applies this restriction to&lt;br /&gt;
all ways in which the same file can be found, even if the file is&lt;br /&gt;
found twice only by virtue of multiple command line arguments.&lt;br /&gt;
However, this strict reading renders existing du implementations&lt;br /&gt;
non-compliant, since they reset their hash of duplicate files when&lt;br /&gt;
proceeding on to additional arguments; meanwhile, GNU du implemented&lt;br /&gt;
this strict reading of the standard, and is in the middle of a debate&lt;br /&gt;
about whether this change from traditional behavior is desirable:&lt;br /&gt;
&lt;a href=&quot;http://debbugs.gnu.org/10281&quot;&gt;http://debbugs.gnu.org/10281&lt;/a&gt; [&lt;a href=&quot;http://debbugs.gnu.org/10281&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
&lt;br /&gt;
This shell sequence demonstrates traditional behavior (as implemented&lt;br /&gt;
on Solaris 10) vs. GNU behavior (the fact that the overall numbers&lt;br /&gt;
differ appears to stem from allocation patterns on the file system,&lt;br /&gt;
and what appears to be a slight algorithm differences between Solaris&lt;br /&gt;
and GNU about whether to favor st_blocks or st_size, and how rounding&lt;br /&gt;
affects matters; but that's unrelated to the point at hand about&lt;br /&gt;
eliding duplicate entries).&lt;br /&gt;
&lt;br /&gt;
$ mkdir tmp &amp;&amp; cd tmp&lt;br /&gt;
$ mkdir a b&lt;br /&gt;
$ printf %04098d 1 &gt; a/a&lt;br /&gt;
$ ln a/a b/b&lt;br /&gt;
$ # both implementations detect that a/a and b/b are links, and elide b/b&lt;br /&gt;
$ /usr/xpg4/bin/du -ak .  &lt;br /&gt;
5 ./a/a&lt;br /&gt;
6 ./a&lt;br /&gt;
1 ./b&lt;br /&gt;
9 .&lt;br /&gt;
$ ~/gnu/du -ak .&lt;br /&gt;
5       ./a/a&lt;br /&gt;
7       ./a&lt;br /&gt;
2       ./b&lt;br /&gt;
10      .&lt;br /&gt;
$ # now, compare when a and b are listed as separate arguments&lt;br /&gt;
$ /usr/xpg4/bin/du -ak a b&lt;br /&gt;
5 a/a&lt;br /&gt;
6 a&lt;br /&gt;
5 b/b&lt;br /&gt;
6 b&lt;br /&gt;
$ ~/gnu/du -ak a b&lt;br /&gt;
5       a/a&lt;br /&gt;
7       a&lt;br /&gt;
2       b&lt;br /&gt;
&lt;br /&gt;
Meanwhile, the existing wording can be deemed self-conflicting, in that&lt;br /&gt;
both the -a and -s options mention listing all arguments given on the&lt;br /&gt;
command line, in contrast to the earlier statement about eliding&lt;br /&gt;
duplicates:&lt;br /&gt;
&lt;br /&gt;
[line 84117] Regardless of the presence of the −a option, non-directories&lt;br /&gt;
given as file operands shall always be listed.&lt;br /&gt;
[line 84185] Instead of the default output, report only the total sum for&lt;br /&gt;
each of the specified files.&lt;br /&gt;
&lt;br /&gt;
In all likelihood, the intent of the standard was to codify traditional&lt;br /&gt;
behavior where the hash for duplicate files is reset each time du&lt;br /&gt;
starts processing the next command line argument, and GNU du was&lt;br /&gt;
wrong for trying to take the standard too literally.  However, it was&lt;br /&gt;
pointed out that the GNU behavior of remembering duplicates across&lt;br /&gt;
multiple command line arguments does have a use not possible in the&lt;br /&gt;
traditional implementation: if a user has multiple directories, all&lt;br /&gt;
of which share some hard links, then only the GNU semantics make it&lt;br /&gt;
possible to see how much disk space will be reclaimed by removing&lt;br /&gt;
the one directory, by invoking 'du -s' with the directory to be&lt;br /&gt;
removed as the last argument.  Therefore, I'm presenting two options&lt;br /&gt;
for solving the conflict in the standard, although my preference&lt;br /&gt;
would be for option 1 (the GNU implementation is willing to change&lt;br /&gt;
its behavior to comply with option 1 by adding an extension option&lt;br /&gt;
to provide its current behavior of remembering links across&lt;br /&gt;
multiple command line arguments, and all other implementations&lt;br /&gt;
already comply with option 1).</description>
<guid>http://www.austingroupbugs.net/view.php?id=527</guid>
<author>eblake &lt;eblake@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=527#bugnotes</comments>
</item>
<item>
<title>0000537: for set -e, compound commands and functions case should be clarified</title>
<link>http://www.austingroupbugs.net/view.php?id=537</link>
<description>URL:&lt;br /&gt;
&lt;a href=&quot;http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_25&quot;&gt;http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_25&lt;/a&gt; [&lt;a href=&quot;http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_25&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
&lt;br /&gt;
Although it is clear what to do in the case of a simple command, in the case of a compound command or a function behavior is unclear. This results in a weird change of execution flow when a function is called from within `if' statement and so on.&lt;br /&gt;
If we take this passage literally, the entire shell should exit in case of an error status of a command called within a function or compound *command* called from `if' compound *list*?&lt;br /&gt;
&lt;br /&gt;
That is, here `reach' would be printed:&lt;br /&gt;
 set -e&lt;br /&gt;
 if false; then echo unreach; fi&lt;br /&gt;
 echo reach&lt;br /&gt;
&lt;br /&gt;
That is, here `reach' would not be printed?&lt;br /&gt;
 set -e&lt;br /&gt;
 if { false; }; then echo unreach; fi&lt;br /&gt;
 echo reach&lt;br /&gt;
&lt;br /&gt;
Fortunately currently existing shell interpreters do not exit shell here, unfortunately they do a bad job instead, they mask -e entirely within compound commands and functions. This results, in the worst case, to alteration of command flow withing a shell function depending on the place where the function was called which is against the expectations of any sane programmer who normally expects that the function must immediately exit after the first error since he is using `set -e'.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
This command&lt;br /&gt;
  { set -e; false; echo ok; } &amp;&amp; echo true&lt;br /&gt;
and this&lt;br /&gt;
  ( set -e; false; echo ok; ) &amp;&amp; echo true&lt;br /&gt;
and this&lt;br /&gt;
  f() { set -e; false; echo ok; }; f &amp;&amp; echo true&lt;br /&gt;
print 'ok' and 'true' at least in bash, sh and zsh.&lt;br /&gt;
Note that calling f without `&amp;&amp; echo true' makes the shell exit without printing 'ok'.&lt;br /&gt;
&lt;br /&gt;
If my proposal is accepted, the above commands would print nothing. It should not affect existing shell scripts in negative manner.</description>
<guid>http://www.austingroupbugs.net/view.php?id=537</guid>
<author>melkov &lt;melkov@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=537#bugnotes</comments>
</item>
<item>
<title>0000052: description of set -e does not match existing practice</title>
<link>http://www.austingroupbugs.net/view.php?id=52</link>
<description>The description of set -e does not match existing practice in&lt;br /&gt;
 several respects, as discussed at length on the austin-group-l&lt;br /&gt;
 mailing list in threads beginning 2009-02-10 (&quot;error handling in&lt;br /&gt;
 shell pipelines&quot;) and 2009-02-17 (&quot;set -e description&quot;).&lt;br /&gt;
&lt;br /&gt;
 The new description of set -e proposed below is taken from the&lt;br /&gt;
 minutes of the March 12th teleconference, with a few minor changes:&lt;br /&gt;
&lt;br /&gt;
 * shallification&lt;br /&gt;
 * changed &quot;!&quot; to &quot;the ! reserved word&quot;&lt;br /&gt;
 * changed &quot;2.8.1&quot; to &quot;[xref to 2.8.1]&quot;&lt;br /&gt;
 * changed &quot;AND or OR list&quot; to &quot;AND-OR list&quot;&lt;br /&gt;
&lt;br /&gt;
 and the two major changes, related to pipelines and functions,&lt;br /&gt;
 discussed in replies to the minutes.&lt;br /&gt;
&lt;br /&gt;
 I have also added the fix to 2.9.2 identified during the original&lt;br /&gt;
 discussion, and some application usage and rationale.</description>
<guid>http://www.austingroupbugs.net/view.php?id=52</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=52#bugnotes</comments>
</item>
<item>
<title>0000535: require support for path separator in function and alias names</title>
<link>http://www.austingroupbugs.net/view.php?id=535</link>
<description>Alias names and function names are may contain path separator characters as an extension. &lt;br /&gt;
&lt;br /&gt;
Using path separators in alias and/or function names is a way to change the execution environment (e.g. the compilation environment) without requiring privileges. For example, a developer may define a function named /usr/bin/cc to hook into executions of the compiler without affecting other users and without requiring administrator privileges.</description>
<guid>http://www.austingroupbugs.net/view.php?id=535</guid>
<author>marko &lt;marko@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=535#bugnotes</comments>
</item>
<item>
<title>0000510: sort -k should allow more than one modifier in [type]</title>
<link>http://www.austingroupbugs.net/view.php?id=510</link>
<description>A strict reading of sort -k 'keydef' says that each optional 'type'&lt;br /&gt;
is a single modifier.  But there are cases where it is desirable to&lt;br /&gt;
have more than one modifier in a -k listing.  Consider a file containing:&lt;br /&gt;
&lt;br /&gt;
 1b1 b&lt;br /&gt;
2a2  b&lt;br /&gt;
3a3 a&lt;br /&gt;
&lt;br /&gt;
In the POSIX locale, this file is correctly sorted under the&lt;br /&gt;
specification of a primary key being the second non-blank character of&lt;br /&gt;
field 1 in reverse order, and a secondary key of the second field&lt;br /&gt;
including blanks in normal order.  But the only way to express this as&lt;br /&gt;
a sort command line is to use multiple types on either the start or the&lt;br /&gt;
end field of key 1; use of a global -b or -r would break the sorting&lt;br /&gt;
desired of the secondary key.  That is, there is no alternative to this&lt;br /&gt;
command line:&lt;br /&gt;
&lt;br /&gt;
printf ' 1b1 b\n2a2  b\n3a3 a\n' | LC_ALL=C sort -k1.2b,1.2rb -k2,2&lt;br /&gt;
&lt;br /&gt;
which would result in the same output, but without using a [type] of rb&lt;br /&gt;
in at least one of the two positions of the first -k option.&lt;br /&gt;
&lt;br /&gt;
My testing shows that GNU, Solaris, BSD, AIX, HP-UX, and IRIX sort all&lt;br /&gt;
support the above use of multiple letters for type, so this proposal&lt;br /&gt;
should not be very controversial.</description>
<guid>http://www.austingroupbugs.net/view.php?id=510</guid>
<author>eblake &lt;eblake@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=510#bugnotes</comments>
</item>
<item>
<title>0000532: clarify atomicity of semctl()</title>
<link>http://www.austingroupbugs.net/view.php?id=532</link>
<description>It would be helpful to clarify the atomicity of semctl() commands, especially&lt;br /&gt;
SETALL; e.g., in the unlikely case of concurrent SETALL operations, or in the&lt;br /&gt;
more likely case when a process is blocked in a semop(), and the values of the&lt;br /&gt;
semaphores in the set are altered by a call to semctl() in another process.&lt;br /&gt;
&lt;br /&gt;
For example, if a semaphore set comprises two semaphores with values {0, 0},&lt;br /&gt;
and a process is blocked in a call to semop() with sem_ops {-1, 0}, it would&lt;br /&gt;
ideally not be possible for this semop() to complete during a call to&lt;br /&gt;
semctl(...,SETALL,...) in another process with arg.array values of {1, 1}.&lt;br /&gt;
&lt;br /&gt;
Regarding existing practice, the Linux semctl() manual page contains the&lt;br /&gt;
following wording, which seems to imply issuing a SETALL or SETVAL command&lt;br /&gt;
when there are pending semop() operations is safe on Linux:&lt;br /&gt;
&lt;br /&gt;
&quot;...If the changes to semaphore values would permit blocked semop(2) calls in&lt;br /&gt;
other processes to proceed, then those processes are woken up.&quot;</description>
<guid>http://www.austingroupbugs.net/view.php?id=532</guid>
<author>weeks &lt;weeks@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=532#bugnotes</comments>
</item>
<item>
<title>0000533: backslash newline in sed s replacement string</title>
<link>http://www.austingroupbugs.net/view.php?id=533</link>
<description>The description of the s command in the sed EXTENDED DESCRIPTION&lt;br /&gt;
includes the following:&lt;br /&gt;
&lt;br /&gt;
    The meaning of a &lt;backslash&gt; immediately followed by any character&lt;br /&gt;
    other than '&amp;' , &lt;backslash&gt;, a digit, or the delimiter character&lt;br /&gt;
    used for this command, is unspecified.&lt;br /&gt;
&lt;br /&gt;
but the paragraph after that describes how backslash can be used&lt;br /&gt;
to escape a newline.&lt;br /&gt;
&lt;br /&gt;
This appears to be a simple editorial omission in the list in the&lt;br /&gt;
quote above.  The propose change adds newline to the list, but&lt;br /&gt;
also moves the sentence to after all of the uses of backslash&lt;br /&gt;
have been described, and inserts &quot;unescaped&quot;.</description>
<guid>http://www.austingroupbugs.net/view.php?id=533</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=533#bugnotes</comments>
</item>
<item>
<title>0000536: missing statement from C99 about no need to generate signals</title>
<link>http://www.austingroupbugs.net/view.php?id=536</link>
<description>C99 contains this statement in 7.14 after the list of signals:&lt;br /&gt;
&lt;br /&gt;
    An implementation need not generate any of these signals, except&lt;br /&gt;
    as a result of explicit calls to the raise function.&lt;br /&gt;
&lt;br /&gt;
For POSIX the same thing can be deduced (explicitly for SIGFPE, SIGILL&lt;br /&gt;
and SIGSEGV, and by implication for the others) from this statement&lt;br /&gt;
after the table of si_code values on the &lt;signal.h&gt; page:&lt;br /&gt;
&lt;br /&gt;
    Implementations [...] may contain extensions or limitations that&lt;br /&gt;
    prevent some values from being generated.&lt;br /&gt;
&lt;br /&gt;
However, it would be better if POSIX contained a direct equivalent&lt;br /&gt;
of the C99 statement.&lt;br /&gt;
&lt;br /&gt;
The proposed change also removes CX shading from something that&lt;br /&gt;
is a statement of fact about the C Standard, and therefore not an&lt;br /&gt;
extension to it.</description>
<guid>http://www.austingroupbugs.net/view.php?id=536</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=536#bugnotes</comments>
</item>
<item>
<title>0000534: unclear phrasing in &quot;mv&quot; regarding same source and destination file</title>
<link>http://www.austingroupbugs.net/view.php?id=534</link>
<description>I. Suppose I want to replace a hard link with a symlink without disturbing other processes that might want to use it:&lt;br /&gt;
&lt;br /&gt;
 &gt;file&lt;br /&gt;
 ln file link&lt;br /&gt;
 ln -s file link.tmp&lt;br /&gt;
 mv -f link.tmp link&lt;br /&gt;
&lt;br /&gt;
Is this required to succeed? What guarantees, if any, are there concerning the state of &quot;link&quot; when all is said and done?&lt;br /&gt;
&lt;br /&gt;
II. Similarly, suppose I do:&lt;br /&gt;
&lt;br /&gt;
 &gt;file&lt;br /&gt;
 ln -s file file.tmp&lt;br /&gt;
 mv -f file.tmp file&lt;br /&gt;
&lt;br /&gt;
Is this required to succeed, and must &quot;file&quot; end up a symlink to itself?&lt;br /&gt;
&lt;br /&gt;
III. How about this?&lt;br /&gt;
&lt;br /&gt;
 &gt;file&lt;br /&gt;
 ln file file2&lt;br /&gt;
 ln -s file link&lt;br /&gt;
 ln -s file2 link.tmp&lt;br /&gt;
 mv -f link.tmp link&lt;br /&gt;
&lt;br /&gt;
Is this required to succeed, and must &quot;link&quot; end up as a symlink to file2 if it does?&lt;br /&gt;
&lt;br /&gt;
Reading the mv specification, it seems to come down to what it means for two operands to name the same file in step (2).&lt;br /&gt;
&lt;br /&gt;
If naming the same file means referring to the same inode after following symlinks (e.g., checked using stat()), that would mean that in example (III) above an implementation can succeed by removing link.tmp and leaving link as a symlink to &quot;file&quot; (step 2c).&lt;br /&gt;
&lt;br /&gt;
I suspect the intent was rather for &quot;name the same file&quot; to mean referring to the same inode after path resolution (e.g., checked using lstat()). This would match the corresponding case in rename():&lt;br /&gt;
&lt;br /&gt;
| If the old argument and the new argument resolve to either the same&lt;br /&gt;
| existing directory entry or different directory entries for the same&lt;br /&gt;
| existing file, rename() shall return successfully and perform no other&lt;br /&gt;
| action.&lt;br /&gt;
&lt;br /&gt;
There might be some alternative non-buggy condition to use. See &lt;a href=&quot;http://debbugs.gnu.org/6960&quot;&gt;http://debbugs.gnu.org/6960&lt;/a&gt; [&lt;a href=&quot;http://debbugs.gnu.org/6960&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;] for some thoughts on that subject.</description>
<guid>http://www.austingroupbugs.net/view.php?id=534</guid>
<author>jrn &lt;jrn@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=534#bugnotes</comments>
</item>
<item>
<title>0000531: Inclusion of &lt;sys/stat.h&gt; may make visible symbols defined in &lt;time.h&gt;</title>
<link>http://www.austingroupbugs.net/view.php?id=531</link>
<description>Struct timespec is allowed (since IEEE Std 1003.1-2001/Cor 2-2004, item XBD/TC2/D6/25) to be defined in &lt;sys/stat.h&gt;, however the text then was not accompagnied by the usual boilerplate &quot;Inclusion of the &lt;sys/stat.h&gt; header may make visible symbols defined in &lt;time.h&gt;&quot; (where &lt;time.h&gt; is the native place where struct timespec is to be fully defined.)&lt;br /&gt;
&lt;br /&gt;
With IEEE Std 1003.1-2008, the definition of struct timespec is no longer optional.&lt;br /&gt;
&lt;br /&gt;
This is at odds with the way struct timespec is handled in the (various) other headers which are referencing it.&lt;br /&gt;
Also several mainstream operating systems took for granted they could import their &lt;time.h&gt; (or &lt;sys/time.h&gt;) namespaces when including &lt;sys/stat.h&gt;; it is certainly not an excuse though.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another solution could be to &quot;move&quot; the reference to struct timespec toward &lt;sys/types.h&gt;, effectively making it a &quot;POSIX base type.&quot; It would lower the name pollution, but the fact it is a struct, not a typedef, could be problematic. Also it won't reduce the already existing pollution (sys/select.h, aio.h are examples.)</description>
<guid>http://www.austingroupbugs.net/view.php?id=531</guid>
<author>antoinel &lt;antoinel@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=531#bugnotes</comments>
</item>
<item>
<title>0000073: wmemcmp C conflict?</title>
<link>http://www.austingroupbugs.net/view.php?id=73</link>
<description>This issue is for tracking purposes.&lt;br /&gt;
&lt;br /&gt;
The following question is being discussed in the C committee at present, and highlights a difference between C-1990 with AMD-1 and C99. POSIX has followed the C89+AMD1 words, and so is possibly at odds with C99.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&gt; from Joseph Myers&lt;br /&gt;
&lt;br /&gt;
When are wide string library functions required to handle values of type &lt;br /&gt;
wchar_t that do not represent any value in the execution character set, &lt;br /&gt;
and when does using such values with a library function result in &lt;br /&gt;
undefined behavior?&lt;br /&gt;
&lt;br /&gt;
Consider the following testcase as an example:&lt;br /&gt;
&lt;br /&gt;
#include &lt;stdlib.h&gt;&lt;br /&gt;
#include &lt;wchar.h&gt;&lt;br /&gt;
&lt;br /&gt;
wchar_t w0 = WCHAR_MIN;&lt;br /&gt;
wchar_t w1 = WCHAR_MAX;&lt;br /&gt;
&lt;br /&gt;
int&lt;br /&gt;
main (void)&lt;br /&gt;
{&lt;br /&gt;
  if (wmemcmp (&amp;w0, &amp;w1, 1) &lt; 0)&lt;br /&gt;
    return 0;&lt;br /&gt;
  else&lt;br /&gt;
    abort ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Suppose that WCHAR_MIN and WCHAR_MAX do not both represent values in the &lt;br /&gt;
execution character set.  If the arguments to wmemcmp are valid, wmemcmp &lt;br /&gt;
must return a value less than 0 because 7.24.4.4 says the comparison is &lt;br /&gt;
done the same way as comparing integers of type wchar_t, so the program &lt;br /&gt;
must execute successfully.  With the GNU C Library, however, it aborts; &lt;br /&gt;
wchar_t is UTF-32 but has a signed type so WCHAR_MIN is negative and does &lt;br /&gt;
not represent a member of the execution character set.&lt;br /&gt;
&lt;br /&gt;
C90 AMD1 had an explicit statement (7.16.4.6) that made clear that these &lt;br /&gt;
inputs were valid (and so wmemcmp had to return a value less than 0 for &lt;br /&gt;
the above example in C90 AMD1):&lt;br /&gt;
&lt;br /&gt;
  These functions operate on arrays of type wchar_t whose size is &lt;br /&gt;
  specified by a separate count argument.  These functions are not &lt;br /&gt;
  affected by locale and all wchar_t values are treated identically.  The &lt;br /&gt;
  null wide character and wchar_t values not corresponding to valid &lt;br /&gt;
  multibyte characters are not treated specially.&lt;br /&gt;
&lt;br /&gt;
I cannot however find any equivalent statement in C99.  Was this a &lt;br /&gt;
deliberate change from AMD1, or a side-effect of how the functions were &lt;br /&gt;
rearranged when added to C99?&lt;br /&gt;
&lt;br /&gt;
POSIX repeats the above requirement from C90 AMD1, but I believe this is &lt;br /&gt;
an accident of taking the specification from there originally and is not &lt;br /&gt;
intended to impose any requirements beyond those of C99.&lt;br /&gt;
&lt;br /&gt;
Much the same issue applies to wcscmp and wcsncmp, where the comparison &lt;br /&gt;
semantics are specified but AMD1 has no mention of wide characters not &lt;br /&gt;
corresponding to members of the execution character set, and in principle &lt;br /&gt;
to other wcs* and wmem* functions that have no reason to need to consider &lt;br /&gt;
the semantics of the characters they process (but are less likely than the &lt;br /&gt;
comparison functions to have problems with the full set of wchar_t values &lt;br /&gt;
in practice).</description>
<guid>http://www.austingroupbugs.net/view.php?id=73</guid>
<author>nick &lt;nick@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=73#bugnotes</comments>
</item>
<item>
<title>0000514: Enhance internal macros in make</title>
<link>http://www.austingroupbugs.net/view.php?id=514</link>
<description>The set of make's internal macros is expanded in some make implementations, or have various restrictions removed.&lt;br /&gt;
&lt;br /&gt;
The &quot;$&lt;&quot; value has special-case restrictions; remove them.  Also, add $^ (list all prerequisites without dups) and $+ (list all prerequisites with dups - e.g., for linking).</description>
<guid>http://www.austingroupbugs.net/view.php?id=514</guid>
<author>dwheeler &lt;dwheeler@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=514#bugnotes</comments>
</item>
<item>
<title>0000506: additional grantpt errors are possible</title>
<link>http://www.austingroupbugs.net/view.php?id=506</link>
<description>In several implementations, grantpt() is implemented by forking and execing&lt;br /&gt;
a setuid helper application to make the requested changes on the slave side&lt;br /&gt;
of the just-opened pseudo-terminal.  Therefore, we probably ought to document&lt;br /&gt;
additional possible errno values.</description>
<guid>http://www.austingroupbugs.net/view.php?id=506</guid>
<author>eblake &lt;eblake@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=506#bugnotes</comments>
</item>
<item>
<title>0000530: Support in-place editing in sed (-iEXTENSION)</title>
<link>http://www.austingroupbugs.net/view.php?id=530</link>
<description>I propose standardizing option(s) so sed users can perform in-place editing of files in an easier, more efficient, and less error-prone way.  This capability is already supported in several widely-used sed implementations using (at least) the “-i” option; I know it’s in at least GNU sed, FreeBSD sed, and MacOS sed.  Here are the details on why I think this is worth standardizing.&lt;br /&gt;
&lt;br /&gt;
It is extremely common for sed to be used on already-existing files to make changes.  Currently, the obvious way to do this portably is to combine sed with mv or cp.  That works, but this is overly complicated for such a common simple task, especially when there are multiple files (e.g., find … -exec … {}.bak isn’t portable, and using while loops portably and correctly requires read -r, IFS setting, quoting everywhere, and assuming filenames won’t include newline). It is also inefficient; this starts at least two processes for each file, and sed must be re-initialized separately for each file (again, this matters when there are many files).&lt;br /&gt;
&lt;br /&gt;
Search-and-replace becomes really easy to do efficiently with in-place editing. E.g.:&lt;br /&gt;
find . -name &quot;*.c&quot; -exec sed -i.bak -e 's/foo/bar/g' {} +&lt;br /&gt;
or if it’s just the current directory:&lt;br /&gt;
sed -i.bak -e 's/foo/bar/g' *.c&lt;br /&gt;
&lt;br /&gt;
A variety of sed implementations support in-place editing:&lt;br /&gt;
* GNU sed: &lt;a href=&quot;http://www.gnu.org/software/sed/manual/html_node/Invoking-sed.html#Invoking-sed&quot;&gt;http://www.gnu.org/software/sed/manual/html_node/Invoking-sed.html#Invoking-sed&lt;/a&gt; [&lt;a href=&quot;http://www.gnu.org/software/sed/manual/html_node/Invoking-sed.html#Invoking-sed&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;] (note that extensions containing “*” are treated specially)&lt;br /&gt;
* FreeBSD sed: &lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=sed&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+8.2-RELEASE&amp;arch=default&amp;format=html&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=sed&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+8.2-RELEASE&amp;arch=default&amp;format=html&lt;/a&gt; [&lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=sed&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+8.2-RELEASE&amp;arch=default&amp;format=html&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;] (it has a -I as well as -i)&lt;br /&gt;
* MacOS sed: &lt;a href=&quot;http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/sed.1.html&quot;&gt;http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/sed.1.html&lt;/a&gt; [&lt;a href=&quot;http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/sed.1.html&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]  (their documentation recommends using an extension to keep a backup, but it does document a no-backup-extension capability).&lt;br /&gt;
&lt;br /&gt;
The Wikipedia article on sed (as of this moment in time) highlights this extension to sed as important, saying: “GNU sed added several new features. The best-known is in-place editing of files (i.e., replace the original file with the result of applying the sed program), which was later included in BSD sed too. This feature is nowadays often used instead of ed scripts....”.&lt;br /&gt;
&lt;br /&gt;
Let me try to quickly counter some objections:&lt;br /&gt;
1. Won’t this imply adding a similar option to every filter?  No.  The “sed” utility is usually used for relatively simple text manipulation cases, so making it especially easy to use for its common case makes sense.&lt;br /&gt;
2. Why should it manipulate files when it deals with streams?  The sed utility already reads data from files, after all, that’s where the data often is.  This option just makes it easier to put the data back where it belongs once stream processing is done.&lt;br /&gt;
&lt;br /&gt;
The good news is that there is widespread support for in-place editing, and the syntax even has wide agreement *if* the original file contents are backed up with an extension.  The syntax, supported by GNU sed, FreeBSD sed, and MacOS sed (at least), is “-iEXTENSION”.  With this, each original “file” is kept as “fileEXTENSION” and the new contents are stored in “file”.  (Perl even copied that syntax; I’m not proposing to standardize perl, just noting that this capability is so common that other tools are copying it.)  These implementations differ subtly in semantics if “*” is part of the extension, because in GNU sed, every instance of “*” is replaced with the filename.  I don’t think this GNU sed capability is used often and thus doesn’t need to be standardized; it’d be easy to just declare that the semantics are undefined if “*” is part of EXTENSION, so that GNU sed can keep doing that but no one else has to copy it.  In all cases, line numbering restarts at 1 for each new file, and “$” matches the end of each file.&lt;br /&gt;
&lt;br /&gt;
Sadly, GNU sed and FreeBSD/MacOS differ on the syntax if no extension is cuddled right after the “-i”.  In GNU sed, the extension is optional; if it’s not immediately cuddled after the “-i” then there is no extension, and no backup is kept (perl uses this syntax too).  In FreeBSD and MacOS, the extension is required; if no extension is cuddled after the “-i” then the NEXT ARGUMENT is used as the extension, and if that next argument is the 0-length &quot;&quot;, no backup is kept.  So everyone supports backups if you just cuddle the extension right after “-i”.  In addition, everyone supports omitting the backup, but they have slightly different incompatible syntaxes for doing so, which leads to an interesting question in that case.&lt;br /&gt;
&lt;br /&gt;
I see these options for standardizing in-place editing without backups:&lt;br /&gt;
1. Don’t support it in the standard; require that backups be kept when using -i, and require users to do the mv by hand if they don’t want backups.  I think that’s a bad idea.  Not needing backups is common (particularly when it’s part of a script or makefile command), so people will probably keep using nonstandard constructs for common cases.  If someone uses -i on “all files” and forgets to erase the backups after each time, they can end up with file.bak, file.bak.bak, file.bak.bak.bak, and so on. It’s also a problem when you have many big files; the option flag system shouldn’t force people to keep backups if they are processing 10,000 files that are a gigabyte each!  The standard can do better.&lt;br /&gt;
2. Require everyone to support -i &quot;&quot;  (a separate null-length argument) as a special case meaning “don’t keep a backup”.  FreeBSD and MacOS do this already.  This would require a patch to GNU sed, but it’s hard to imagine that this weird extension would interfere with any scripts; a null-length string is not a valid option, and it’s not a valid filename.  GNU sed could, when it confronts “-i” with no extension, look at the next parameter to see if it’s zero-length and consume it if it is.  It is odd, however.&lt;br /&gt;
3. Create a new option flag to mean “-i, but do not keep backup files”.  I don’t care so much which flag is used, but in the spirit of putting forth a concrete proposal, I would propose “-N” (for iN-place).  This would be a standards committee invention, but the invention is not the ability (many sed implementations have this).  The invention is the name of a common option flag, created because there are incompatible interfaces in current practice and the point of a standard is to create some common way to invoke functionality.&lt;br /&gt;
&lt;br /&gt;
I’m currently proposing #3, but option #2 would work too.&lt;br /&gt;
&lt;br /&gt;
If we wish to stay compatible with current practice this a minor violation of XBD 12.1 point 2a.  Basically, users MUST cuddle the extension right after “-i” (as this is the agreed-on intersection between GNU and FreeBSD/Apple).  But lots of commands already violate XBD 12.1 in various small ways.  This particular kind of minor violation occurs in several other places in the standard.  In addition, it doesn’t create a new violation, it just documents a minor violation already in existing practice.</description>
<guid>http://www.austingroupbugs.net/view.php?id=530</guid>
<author>dwheeler &lt;dwheeler@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=530#bugnotes</comments>
</item>
<item>
<title>0000521: Behaviour of !(command) should not be specified</title>
<link>http://www.austingroupbugs.net/view.php?id=521</link>
<description>Currently section 2.9.2, in combination with the tokenisation rules&lt;br /&gt;
and grammar, requires that !(command) is treated as a pipeline&lt;br /&gt;
beginning with the reserved word ! and containing a subshell command.&lt;br /&gt;
&lt;br /&gt;
However, in ksh88 this was treated as a negated pathname expansion&lt;br /&gt;
!(pattern), not a negated subshell command.  Since the POSIX shell&lt;br /&gt;
description was based on ksh88, specifying negated pipelines in a way&lt;br /&gt;
that made ksh88 non-conforming was clearly not intended.</description>
<guid>http://www.austingroupbugs.net/view.php?id=521</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=521#bugnotes</comments>
</item>
<item>
<title>0000522: Says shmat() returns -1 on error; should be (void*)-1</title>
<link>http://www.austingroupbugs.net/view.php?id=522</link>
<description>The declaration for shmat() is:&lt;br /&gt;
&lt;br /&gt;
    void *shmat(int shmid, const void *shmaddr, int shmflg);&lt;br /&gt;
&lt;br /&gt;
The description of the returned value say, in part:&lt;br /&gt;
&lt;br /&gt;
Otherwise, the shared memory segment shall not be attached, shmat() shall return -1, and errno shall be set to indicate the error.&lt;br /&gt;
&lt;br /&gt;
-1 is of type int, not of type void*</description>
<guid>http://www.austingroupbugs.net/view.php?id=522</guid>
<author>kst &lt;kst@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=522#bugnotes</comments>
</item>
<item>
<title>0000523: Add support for special target .PHONY in make</title>
<link>http://www.austingroupbugs.net/view.php?id=523</link>
<description>It is often useful to define &quot;make&quot; targets that are not simply the name of a file generated when running make, but are instead the name of a &quot;recipe&quot; to do some task by that name.  In these cases, it is useful to be able to declare that these targets are &quot;PHONY&quot; using the .PHONY special target.  Such targets are considered to not exist for the purposes of make's execution.&lt;br /&gt;
&lt;br /&gt;
One use case is names for items that will never create a file.  &quot;make all&quot;, &quot;make test&quot;, and &quot;make clean&quot; are some common cases.  It's common to see:&lt;br /&gt;
 .PHONY: all&lt;br /&gt;
 all: prog1 prog2&lt;br /&gt;
So that &quot;make all&quot; will always make &quot;prog1&quot; and &quot;prog2&quot;.  Otherwise, if a file &quot;all&quot; was ever created in the directory, &quot;make all&quot; probably fail to work as intended.  Instead, make will check to see that all came after prog1 and prog2, and if it is, is will not rebuild prog1 and prog2 as needed.  There are also performance advantages; on systems with rule chaining, implicit rule searching can be short-circuited (since the system knows the file will not exist, for make's purposes).&lt;br /&gt;
&lt;br /&gt;
Another use case is when you want to name subdirectories, so that &quot;make DIR&quot; will execute the default makefile for some subdirectory DIR.  In this case, the subdirectory DIR will already exist, making it more convoluted to execute the make.  By declaring DIR as .PHONY, make will ignore the fact that the directory already exists, and act as if it did not.&lt;br /&gt;
&lt;br /&gt;
Many implementations of &quot;make&quot; include support for the special target .PHONY, including:&lt;br /&gt;
* GNU make&lt;br /&gt;
* NetBSD make (implemented as &quot;bmake&quot; on Fedora Linux)&lt;br /&gt;
* FreeBSD’s make &lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=make&amp;sektion=1&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=make&amp;sektion=1&lt;/a&gt; [&lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=make&amp;sektion=1&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
* OpenBSD’s make &lt;a href=&quot;http://www.openbsd.org/cgi-bin/man.cgi?query=make&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html&quot;&gt;http://www.openbsd.org/cgi-bin/man.cgi?query=make&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html&lt;/a&gt; [&lt;a href=&quot;http://www.openbsd.org/cgi-bin/man.cgi?query=make&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
* fastmake &lt;a href=&quot;http://www.fastmake.org/doc.html&quot;&gt;http://www.fastmake.org/doc.html&lt;/a&gt; [&lt;a href=&quot;http://www.fastmake.org/doc.html&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
&lt;br /&gt;
For example, here is FreeBSD's documentation on .PHONY:&lt;br /&gt;
.PHONY     Apply the .PHONY attribute to any specified sources.  Targets with this attribute are always considered to be out of date.&quot;&lt;br /&gt;
&lt;br /&gt;
This is so useful that even some very basic introductions to &quot;make&quot; include it, e.g.:&lt;br /&gt;
&lt;a href=&quot;http://linuxdevcenter.com/pub/a/linux/2002/01/31/make_intro.html?page=2&quot;&gt;http://linuxdevcenter.com/pub/a/linux/2002/01/31/make_intro.html?page=2&lt;/a&gt; [&lt;a href=&quot;http://linuxdevcenter.com/pub/a/linux/2002/01/31/make_intro.html?page=2&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
&lt;br /&gt;
Phony targets can have prerequisites, but I don't think that needs to be specified here; the existing make specification handles that quite well without any additional material.&lt;br /&gt;
&lt;br /&gt;
I didn't find much documentation on what should happen with a blank target list for phony, that is:&lt;br /&gt;
.PHONY:&lt;br /&gt;
but both GNU make and NetBSD make ignore such statements, which seems reasonable enough.  Erasing the list, as with .SUFFIXES, seems like a bad idea.&lt;br /&gt;
&lt;br /&gt;
I did add to the definition some material that's only implied in typical documentation.  Once you &quot;build&quot; a phony target, it's not rebuilt again during that execution of 'make'.  For example, &quot;make all&quot; will print &quot;Hello there&quot; only once, not twice, given this makefile:&lt;br /&gt;
all: def ghi&lt;br /&gt;
def: abc&lt;br /&gt;
ghi: abc&lt;br /&gt;
abc:&lt;br /&gt;
	@echo &quot;Hello there&quot;&lt;br /&gt;
.PHONY: abc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can sort-of get the effect of .PHONY in the first case by selecting a file you're &quot;sure&quot; won't happen, e.g., &quot;FORCE&quot;:&lt;br /&gt;
     clean: FORCE&lt;br /&gt;
             rm $(objects)&lt;br /&gt;
     FORCE:&lt;br /&gt;
However, using .PHONY is more specific and efficient (especially if a make implements rule chaining or complex VPATHs).  And if someone creates a file named FORCE, very weird things happen in this case.  (If the filesystem folds case, which happens on some systems, even creating files like &quot;force&quot; can cause real problems.)  And this approach completely fails to handle the case where you'd like to allow &quot;make DIR&quot;, where DIR is the name of a subdirectory to be built.  As a result, many &quot;make&quot; implementations include .PHONY.</description>
<guid>http://www.austingroupbugs.net/view.php?id=523</guid>
<author>dwheeler &lt;dwheeler@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=523#bugnotes</comments>
</item>
<item>
<title>0000525: portable makefile example</title>
<link>http://www.austingroupbugs.net/view.php?id=525</link>
<description>The standard is redundant: this text appears in both APPLICATION&lt;br /&gt;
USAGE (lines 96098-96102) and RATIONALE (lines 96267-96271):&lt;br /&gt;
&lt;br /&gt;
&quot;The best way to provide portable makefiles is to include all of the&lt;br /&gt;
rules needed in the makefile itself. The rules provided use only&lt;br /&gt;
features provided by other parts of this volume of POSIX.1-2008. The&lt;br /&gt;
default rules include rules for optional commands in this volume of&lt;br /&gt;
POSIX.1-2008. Only rules pertaining to commands that are provided are&lt;br /&gt;
needed in an implementation’s default set.&quot;&lt;br /&gt;
&lt;br /&gt;
Furthermore, the standard requires that a portable makefile start with&lt;br /&gt;
the special target .POSIX, then proceeds to give an example makefile&lt;br /&gt;
that does not use that target.  The remaining examples only claim to&lt;br /&gt;
be a portion of a makefile, rather than an entire makefile.</description>
<guid>http://www.austingroupbugs.net/view.php?id=525</guid>
<author>eblake &lt;eblake@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=525#bugnotes</comments>
</item>
<item>
<title>0000330: In make, add support for assignments &quot;::=&quot;, &quot;+=&quot;, and &quot;?=&quot;.</title>
<link>http://www.austingroupbugs.net/view.php?id=330</link>
<description>The widely-supported additional assignment operators &quot;:=&quot;, &quot;+=&quot;, and &quot;?=&quot; should be added to the standard's specification for make, as they greatly speed up and simplify larger systems that use make.  Below are the arguments for each.&lt;br /&gt;
&lt;br /&gt;
Traditional make macros (defined with &quot;=&quot;) cause exponential growth in execution time, inhibiting scalability as systems get bigger and more complex. That's because instead of being expanded when they are defined, they are expanded on use.  A widely-used alternative is &quot;:=&quot;, which creates an 'immediate-expansion' macro (which are expanded immediately) instead of a traditional 'delayed-expansion' macro.&lt;br /&gt;
The article &quot;Recursive Make Considered Harmful&quot;  by Peter Miller&lt;br /&gt;
(&lt;a href=&quot;http://miller.emu.id.au/pmiller/books/rmch/&quot;&gt;http://miller.emu.id.au/pmiller/books/rmch/&lt;/a&gt; [&lt;a href=&quot;http://miller.emu.id.au/pmiller/books/rmch/&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;] and&lt;br /&gt;
&lt;a href=&quot;http://aegis.sourceforge.net/auug97.pdf)&quot;&gt;http://aegis.sourceforge.net/auug97.pdf)&lt;/a&gt; [&lt;a href=&quot;http://aegis.sourceforge.net/auug97.pdf)&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;] notes this as a key problem when creating makefiles,&lt;br /&gt;
and strongly recommends using := instead.&lt;br /&gt;
Similarly, the guidelines &quot;How-to write a makefile&quot; specifically&lt;br /&gt;
recommend using := and not = because of efficiency issues, even for portable makefiles&lt;br /&gt;
(&lt;a href=&quot;http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/how-to-write-a-makefile)&quot;&gt;http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/how-to-write-a-makefile).&lt;/a&gt; [&lt;a href=&quot;http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/how-to-write-a-makefile)&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
&lt;br /&gt;
Immediately-expanded macros are not only more efficient, they also tend to be easier for developers to use.  Traditional macros are very different from &quot;normal&quot; variables in other languages, and thus traditional macros are also a trap for the unwary.  Since := style macros work like traditional variables, using them eliminates a subtle source of errors.&lt;br /&gt;
&lt;br /&gt;
The &quot;+=&quot; (append) and &quot;?=&quot; (set if not already set) simplify setting macro variables.  These make it simple to perform relatively common operations.  These are especially helpful in larger systems with multiple makefiles that are combined together into a single large run of 'make'.&lt;br /&gt;
&lt;br /&gt;
The &quot;:=&quot;, &quot;+=&quot;, and &quot;?=&quot; operators already have wide support:&lt;br /&gt;
* GNU make: &lt;a href=&quot;http://www.gnu.org/software/autoconf/manual/make/index.html&quot;&gt;http://www.gnu.org/software/autoconf/manual/make/index.html&lt;/a&gt; [&lt;a href=&quot;http://www.gnu.org/software/autoconf/manual/make/index.html&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
* FreeBSD make: &lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=make&amp;sektion=1&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=make&amp;sektion=1&lt;/a&gt; [&lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=make&amp;sektion=1&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
* OpenBSD make: &lt;a href=&quot;http://www.openbsd.org/cgi-bin/man.cgi?query=make&quot;&gt;http://www.openbsd.org/cgi-bin/man.cgi?query=make&lt;/a&gt; [&lt;a href=&quot;http://www.openbsd.org/cgi-bin/man.cgi?query=make&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
* Solaris make: &lt;a href=&quot;http://developers.sun.com/solaris/articles/make_utility.html&quot;&gt;http://developers.sun.com/solaris/articles/make_utility.html&lt;/a&gt; [&lt;a href=&quot;http://developers.sun.com/solaris/articles/make_utility.html&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
* MKS make supports := and += (though not ?=) &lt;a href=&quot;http://www.mkssoftware.com/docs/man1/make.1.asp&quot;&gt;http://www.mkssoftware.com/docs/man1/make.1.asp&lt;/a&gt; [&lt;a href=&quot;http://www.mkssoftware.com/docs/man1/make.1.asp&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
There are probably others, but that should be enough to make the point.  There's some common code heritage, of course, but my point is that it's widely available, and thus should be in the standard.&lt;br /&gt;
&lt;br /&gt;
These additions are relatively simple to implement, for the rare implementations that don't already have them.</description>
<guid>http://www.austingroupbugs.net/view.php?id=330</guid>
<author>dwheeler &lt;dwheeler@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=330#bugnotes</comments>
</item>
<item>
<title>0000526: Adopt C99 wording for zero size calloc(), malloc() et al.</title>
<link>http://www.austingroupbugs.net/view.php?id=526</link>
<description>While correcting the application of &lt;a href=&quot;http://www.austingroupbugs.net/view.php?id=400&quot;&gt;0000400&lt;/a&gt; in the TC1 draft it was&lt;br /&gt;
noticed that the wording related to the zero size case for calloc(),&lt;br /&gt;
malloc() and realloc() is different in C99, which says:&lt;br /&gt;
&lt;br /&gt;
    If the size of the space requested is zero, the behavior is&lt;br /&gt;
    implementation-defined: either a null pointer is returned, or the&lt;br /&gt;
    behavior is as if the size were some nonzero value, except that&lt;br /&gt;
    the returned pointer shall not be used to access an object.&lt;br /&gt;
&lt;br /&gt;
The C99 wording is better because it avoids explicit mention of&lt;br /&gt;
passing the returned pointer to free(), thus ensuring there can be no&lt;br /&gt;
doubt about whether the pointer can also be deallocated by realloc().&lt;br /&gt;
&lt;br /&gt;
In fact, &lt;a href=&quot;http://www.austingroupbugs.net/view.php?id=400&quot;&gt;0000400&lt;/a&gt; already changes the realloc() DESCRIPTION wording&lt;br /&gt;
to match C99 but does not remove the now-redundant mention of free()&lt;br /&gt;
in the RETURN VALUE section.&lt;br /&gt;
&lt;br /&gt;
The proposed changes also make the errno handling for calloc() and&lt;br /&gt;
malloc() more consistent with the realloc() change in &lt;a href=&quot;http://www.austingroupbugs.net/view.php?id=400&quot;&gt;0000400&lt;/a&gt;,&lt;br /&gt;
although using &quot;may&quot; because they don't have the same need for&lt;br /&gt;
errno to indicate that the space was not freed.&lt;br /&gt;
&lt;br /&gt;
In addition they tidy up an editorial problem with duplicate&lt;br /&gt;
statements in the &lt;a href=&quot;http://www.austingroupbugs.net/view.php?id=400&quot;&gt;0000400&lt;/a&gt; text about the returned pointer being&lt;br /&gt;
used to access an object.  (The statement is made once as &quot;shall not&lt;br /&gt;
be used&quot; as in C99, and once as &quot;the application shall ensure ...&quot;;&lt;br /&gt;
the changes turn the first one into a statement about undefined&lt;br /&gt;
behaviour, since the second is the appropriate POSIX wording.)&lt;br /&gt;
&lt;br /&gt;
For consistency, similar changes should be made for posix_memalign().</description>
<guid>http://www.austingroupbugs.net/view.php?id=526</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=526#bugnotes</comments>
</item>
</channel>
</rss>

