Bug 133866 - Bogus THROW spec in /usr/include/utime.h
Summary: Bogus THROW spec in /usr/include/utime.h
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 3
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-09-28 00:29 UTC by Tom Lane
Modified: 2016-11-24 16:15 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-09-28 07:55:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


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