Defect Report #289

Previous Defect Report < - > Next Defect Report


Submitter: Andrew Josey via Fred Tydeman
Submission Date: 2003-08-15
Source: The Open Group
Reference Document: Open Group aardvark 117
Version: 1.2
Date: 2004-03-03
Subject: Function prototype with [restrict]

Summary

6.7.6 (direct-abstract-declarator) is inconsistent with 6.7.5 (direct-declarator) with respect to omitting an identifier from a declaration to form a type name.

Here is a specific example that shows the problem.

 int lio_listio(int, struct aiocb *restrict const[restrict]);

is invalid and appears to have to be done as:
 int lio_listio(int, struct aiocb *restrict const __FOO[restrict]);

6.7.6 Type names, paragraph 2 has:
In several contexts, it is necessary to specify a type. This is accomplished using a type name, which is syntactically a declaration for a function or an object of that type that omits the identifier.

So you would think that if

  struct aiocb *restrict const __FOO[restrict]

is a valid declaration of the object __FOO, then it should follow from the above statement that
  struct aiocb *restrict const [restrict]

must be a valid type name.

Technical Corrigendum
In the syntax rules for direct-abstract-declarator in 6.7.6 paragraph 1, replace

direct-abstract-declaratoropt [ assignment-expressionopt ]
with
direct-abstract-declaratoropt [ type-qualifier-listopt assignment-expressionopt ]
direct-abstract-declaratoropt [ static type-qualifier-listopt assignment-expression ]
direct-abstract-declaratoropt [ type-qualifier-list static assignment-expression ]


Previous Defect Report < - > Next Defect Report