Re: __attribute__((warn_unused_result)) for NetBSD?
Aleksey Cheusov <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.general |
|---|---|
| Message-ID | <[email protected]> |
> Today while trying to bootstrap pkgsrc under ALT Linux I've found that > several functions such as fwrite, write, chdir and probably others > are declared with __attribute__((warn_unused_result)) attribute. > This obviously generates useful warning/errors for the key components > of the system. > NetBSD Guide says that code cleaness is one of the main goal of > NetBSD. Due to this I consider that this approach seems reasonable for > NetBSD too. > It is interesting to hear/see NetBSD developer's opinions. More complete list of "protected" functions in glibc-2.7: a64l abs asprintf atof atoi atol atoll brk bsearch calloc canonicalize_file_name chdir chown daemon div dup dup2 ecvt faccessat fchdir fchmodat fchownat fcvt fdopen feof ferror fgets fgetws fileno fmemopen fopen fread freopen fscanf ftell ftello ftruncate ftrylockfile fwrite gcvt getcwd getdelim getdomainname getenv getgroups getline gets getsubopt getwd l64a lchown ldiv link linkat llabs lldiv lockf malloc mblen mbtowc memalign mkdtemp mkostemp mkstemp mktemp nice pipe popen posix_memalign posix_openpt pread ptsname pvalloc pwrite qecvt qfcvt qgcvt read readlink realpath revoke rpmatch scanf setdomainname sethostid sethostname sscanf strtod strtod_l strtof strtof_l strtoimax strtol strtol_l strtold strtold_l strtoll strtoll_l strtoq strtoul strtoul_l strtoull strtoull_l strtouq symlink symlinkat system tempnam tmpfile tmpnam tmpnam_r truncate ttyname_r valloc vasprintf vfscanf vscanf vsscanf wcrtomb wcstoimax wcstol wctomb write -- Best regards, Aleksey Cheusov.