Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001413 [Issue 8 drafts] Shell and Utilities Objection Error 2020-10-24 22:01 2020-10-24 22:01
Reporter philip-guenther View Status public  
Assigned To
Priority normal Resolution Open  
Status New   Product Version Draft 1.1
Name Philip Guenther
Organization OpenBSD
User Reference
Section printf's APPLICATION USAGE
Page Number 3038
Line Number 102845 - 102848
Final Accepted Text
Summary 0001413: incorrect description of how a hexadecimal character constant can be terminated in ISO C
Description The text says:

> In the ISO C standard, the "##" concatenation
> operator can be used to terminate a constant and follow it with a hexadecimal character to be
> written. In the shell, concatenation occurs before the printf utility has a chance to parse the end
> of the hexadecimal constant.

The ## operator is neither necessary nor sufficient. All that's needed is use of string literal concatenation.

Indeed, this was an example in (at least) drafts of the C99 standard, in the specification of string literals lexical elements:

# EXAMPLE This pair of adjacent character string literals
#
# "\x12" "3"
#
# produces a single character string literal containing the two characters whose values are '\x12' and '3',
# because escape sequences are converted into single members of the execution character set just prior to
# adjacent string literal concatenation.
Desired Action Replace the sentence:
  In the ISO C standard, the "##" concatenation operator can be used to terminate a constant and follow it with a hexadecimal character to be written.

With something like:
  In the ISO C standard, the constant and its following hexadecimal character can be placed in separate string literals as escape sequence processing occurs before string literal concatenation.

(I'm not really happy with that phrasing; better suggestions welcome!)
Tags No tags attached.
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2020-10-24 22:01 philip-guenther New Issue
2020-10-24 22:01 philip-guenther Name => Philip Guenther
2020-10-24 22:01 philip-guenther Organization => OpenBSD
2020-10-24 22:01 philip-guenther Section => printf's APPLICATION USAGE
2020-10-24 22:01 philip-guenther Page Number => 3038
2020-10-24 22:01 philip-guenther Line Number => 102845 - 102848


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker