Bug 133866

Summary: Bogus THROW spec in /usr/include/utime.h
Product: [Fedora] Fedora Reporter: Tom Lane <tgl>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: medium    
Version: 3CC: fweimer, hhorak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-28 07:55:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom Lane 2004-09-28 00:29:55 UTC
Description of problem: gcc -Wall generates a warning "null argument
where non-null required" when the second argument of utime() is NULL.
A null second argument is legal per the man page, per the Single Unix
Spec, and per experiment, so the warning is bogus.  Accordingly, the
THROW spec in /usr/include/utime.h is wrong.

Version-Release number of selected component (if applicable):
glibc-headers-2.3.3-55

How reproducible: Always.

Steps to Reproduce:
[tgl@rh1 ~]$ cat utimetest.c
#include <stdlib.h>
#include <sys/types.h>
#include <utime.h>

int main(int argc, char** argv)
{
  char * path = argv[1];

  utime(path, NULL);

  return 0;
}
[tgl@rh1 ~]$ gcc -Wall utimetest.c
utimetest.c: In function `main':
utimetest.c:9: warning: null argument where non-null required (arg 2)
[tgl@rh1 ~]$ ./a.out a.out
[tgl@rh1 ~]$ -- note lack of crash
 
Actual results:


Expected results: No warning.


Additional info:

Comment 1 Jakub Jelinek 2004-09-28 07:55:41 UTC
The problem was not in __THROW (which is something completely else),
but with __nonnull ((1, 2)) attribute on utime which ought to be
__nonnull ((1)).
Fixed in CVS, will make it into next rawhide rpms.