Email List: Xaustin-review-lX
[All Lists]

Defect in XSH lio_listio

To: austin-review-l@xxxxxxxxxxxxx
Subject: Defect in XSH lio_listio
From: mstrbill@xxxxxxxxxx
Date: Wed, 1 Aug 2007 19:29:48 +0100 (BST)
        Defect report from : William L. Toth , IBM Austin

(Please direct followup comments direct to austin-group-l@xxxxxx)

@ page 888 line 29036 section lio_listio objection {WLT-SUS3-1}

Problem:

Edition of Specification (Year): 2004

Defect code :  1. Error


The SUSv3 TC2 standard uses the restrict keyword improperly in some System Call 
declarations. The C99 standard section 6.7.5.2 states:

6.7.5.2 Array declarators
The optional type qualifiers and the keyword static shall appear only in a 
declaration of a function parameter with an array type, and then only in the 
outermost array type derivation.

6.7.5.3 Function declarators (including prototypes)
21 EXAMPLE 5 The following are all compatible function prototype declarators.as 
are:

void f(double (* restrict a)[5]);
void f(double a[restrict][5]);

The following prototypes have the restrict keyword inside the brackets which 
violates the wording above:

23036 int lio_listio(int mode, struct aiocb *restrict const list[restrict],
23037 int nent, struct sigevent *restrict sig);

28930 int posix_spawn(pid_t *restrict pid, const char *restrict path,
28931 const posix_spawn_file_actions_t *file_actions,
28932 const posix_spawnattr_t *restrict attrp,
28933 char *const argv[restrict], char *const envp[restrict]);

28934 int posix_spawnp(pid_t *restrict pid, const char *restrict file,
28935 const posix_spawn_file_actions_t *file_actions,
28936 const posix_spawnattr_t *restrict attrp,
28937 char *const argv[restrict], char * const envp[restrict]);

38164 int regexec(const regex_t *restrict preg, const char *restrict string,
38165 size_t nmatch, regmatch_t pmatch[restrict], int eflags);

Action:

For lio_listio() just remove the restrict keyword from the brackets as list is 
already defined as having restrict qualifier.

For the others, move the restrict keyword to be part of the argument type.

<Prev in Thread] Current Thread [Next in Thread>