https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96832

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
I agree with recommending to use getcwd(0, 0).

At the same time, in https://sourceware.org/bugzilla/show_bug.cgi?id=25219#c6 I
suggested that "...perhaps the attribute should allow the pointer to be null
regardless of the size.  That's what it does now when the size argument isn't
specified.  When the size is specified, the attribute is modeled on functions
like memcpy, but that may not be the most flexible model."

With this change, the attribute on getcwd wouldn't trigger a warning for
getcwd(0, 4096) but would still detect all the usual kinds of bugs.  Let me
look into it.

Reply via email to