The following issue has been SUBMITTED. 
====================================================================== 
https://www.austingroupbugs.net/view.php?id=1413 
====================================================================== 
Reported By:                philip-guenther
Assigned To:                
====================================================================== 
Project:                    Issue 8 drafts
Issue ID:                   1413
Category:                   Shell and Utilities
Type:                       Error
Severity:                   Objection
Priority:                   normal
Status:                     New
Name:                       Philip Guenther 
Organization:               OpenBSD 
User Reference:              
Section:                    printf's APPLICATION USAGE 
Page Number:                3038 
Line Number:                102845 - 102848 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2020-10-24 22:01 UTC
Last Modified:              2020-10-24 22:01 UTC
====================================================================== 
Summary:                    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!)
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2020-10-24 22:01 philip-guentherNew Issue                                    
2020-10-24 22:01 philip-guentherName                      => Philip Guenther 
2020-10-24 22:01 philip-guentherOrganization              => OpenBSD         
2020-10-24 22:01 philip-guentherSection                   => printf's
APPLICATION USAGE
2020-10-24 22:01 philip-guentherPage Number               => 3038            
2020-10-24 22:01 philip-guentherLine Number               => 102845 - 102848 
======================================================================


  • [Issue 8 dra... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group

Reply via email to