Your message dated Mon, 31 Jul 2017 22:34:14 +0200
with message-id <[email protected]>
and subject line manpages-dev does not need improvement
has caused the Debian Bug report #858866,
regarding manpages-dev: improve documentation for strchrnul
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
858866: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858866
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libc6-dev
Version: 2.24-9
Severity: normal

Dear Maintainer,

See this code:

#include <stdio.h>
#define _GNU_SOURCE
#include <string.h>
int main() {
    const char * filename = "cia<o.txt ";
    const char *ptr = filename + strlen(filename);

    char *pos = strchrnul(filename, (int)'<');
    if (pos < ptr)
        ptr = pos;
    printf("%d\n", ptr == filename + strlen(filename));
}

It doesn't work because the _GNU_SOURCE define happens after an include.

The man page for strchrnul only specifies to define it before the string.h
include, but probably it would be best to mention that it needs to be before
any include, otherwise it's just undefined behaviour.

-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libc6-dev depends on:
ii  libc-dev-bin    2.24-9
ii  libc6           2.24-9
ii  linux-libc-dev  4.9.16-1

libc6-dev recommends no packages.

Versions of packages libc6-dev suggests:
pn  glibc-doc     <none>
ii  manpages-dev  4.09-2

-- no debconf information

--- End Message ---
--- Begin Message ---
Hi,

thanks for your bug report. However, I don't think that the manpage
needs improvements, the documentation is already there.

Please see the manpage feature_test_macros.7, here you'll find in the
description the second paragraph with bold and underlined text:

"NOTE: In order to be effective, a feature test macro must be
defined before including any header files.  This can be done
either in the compilation command (cc -DMACRO=value) or by
defining the macro within the source code before including
any headers."

Moreover, there's a whole section about this topic, to be found under
the headline "Specification of feature test macro requirements in manual
pages", just a couple of lines further down.

I'm therefore closing this bug.

Regards,
Tobias

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

Reply via email to