View Issue Details

IDProjectCategoryView StatusLast Update
00010171003.1(2013)/Issue7+TC1Shell and Utilitiespublic2024-06-11 08:58
Reportergeoffclare Assigned To 
PrioritynormalSeverityObjectionTypeClarification Requested
Status ClosedResolutionAccepted 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectionod
Page Number3012
Line Number99876-99881
Interp Status---
Final Accepted Text
Summary0001017: od -A n and final offset
DescriptionThe extended description for od has a paragraph about writing the
byte offsets, which begins "Unless -A n is specified, ..." and ends
with the sentence "In addition, the offset of the byte following the
last byte written shall be written after all the input data has been
processed, but shall not be followed by any <blank> characters."

It is not clear whether or not this last sentence is covered by
the "Unless" clause at the beginning of the paragraph. If it is
not covered, then with -A n the line which would have contained that
final offset should still be written, but without the actual offset
(i.e. an empty line); if it is covered, then the line should not be
written at all. Some implementations write an empty line and some don't.

Although it seems pointless to write the empty line, it is what all
certified UNIX systems do, so I would prefer that the standard is
clarified to explicitly allow both behaviours.
Desired ActionAdd a new sentence to the end of the paragraph:

If -A n is specified, it is unspecified whether the line that would contain this final offset is written as an empty line or is not written.
Tagstc3-2008

Activities

joerg

2016-01-04 16:36

reporter   bugnote:0002994

It seems that the word "unless" does not make sense in the whole following text-

The way I read the text, the final address always needs to be written.

Do you know of a POSIX certified od implementation that does not print the final address line?

shware_systems

2016-01-04 19:19

reporter   bugnote:0002995

I agree with Joerg. The final value represents a separate report of the relative number of bytes processed for that invocation, not the start value for a particular block that -A n applies to. For a single file that value minus any specified start offset is the actual count. The -A description doesn't refer to it also being excluded, anyways, and should if that is the intent. It reads more as a non-optional output line as things are, by the 'shall be written' assertion.

In terms of formatting it should be explicitly followed by a newline too, imo, so the output of the run is a full line not just reported without alignment blanks as is stated, and if -A o, d, or x is specified that overrides the default base used when the -A missing, or -A n option is present, for the report. This is implied by the examples, but appears normatively ambiguous.

geoffclare

2016-01-05 09:09

manager   bugnote:0002996

Nobody writes the final offset when -A n is used. Existing behaviour is either to write an empty line there (i.e. the final offset line without the actual offset) or nothing at all.

joerg

2016-01-06 15:23

reporter   bugnote:0003011

I know of no certified implementation that omits the final address line.

Does somebody know such an implementation?

Issue History

Date Modified Username Field Change
2016-01-04 15:59 geoffclare New Issue
2016-01-04 15:59 geoffclare Name => Geoff Clare
2016-01-04 15:59 geoffclare Organization => The Open Group
2016-01-04 15:59 geoffclare Section => od
2016-01-04 15:59 geoffclare Page Number => 3012
2016-01-04 15:59 geoffclare Line Number => 99876-99881
2016-01-04 15:59 geoffclare Interp Status => ---
2016-01-04 16:36 joerg Note Added: 0002994
2016-01-04 19:19 shware_systems Note Added: 0002995
2016-01-05 09:09 geoffclare Note Added: 0002996
2016-01-06 15:23 joerg Note Added: 0003011
2016-10-27 15:42 Don Cragun Status New => Resolved
2016-10-27 15:42 Don Cragun Resolution Open => Accepted
2016-10-27 15:42 Don Cragun Tag Attached: tc3-2008
2019-10-21 13:56 geoffclare Status Resolved => Applied
2024-06-11 08:58 agadmin Status Applied => Closed