Bug 133866 - Bogus THROW spec in /usr/include/utime.h
Bogus THROW spec in /usr/include/utime.h
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
3
All Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-09-27 20:29 EDT by Tom Lane
Modified: 2016-11-24 11:15 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-28 03:55:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tom Lane 2004-09-27 20:29:55 EDT
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 03:55:41 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.