bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #44464] gmk_add_function retains ptr to name it's given


From: Paul D. Smith
Subject: [bug #44464] gmk_add_function retains ptr to name it's given
Date: Sun, 08 Mar 2015 12:15:26 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36

Update of bug #44464 (project make):

              Item Group:                     Bug => Enhancement            

    _______________________________________________________

Follow-up Comment #3:

Technically, you are not supposed to hand any pointer to memory to GNU make
which is not allocated with gmk_alloc(); the docs say:

Thus you should never pass memory that you’ve allocated directly to any make
function, nor should you attempt to directly free any memory returned to you
by any make function. Instead, use the gmk_alloc and gmk_free functions.

This is intended to apply to the function name as well, so you're supposed to
use gmk_alloc() to duplicate the string containing the function name (maybe
writing a utility function like blah_strdup() or something) and pass that to
gmk_add_function().

That could be made clearer in the documentation.  Also this rule could be
relaxed, and as you suggest GNU make could duplicate the function name itself,
for safety.  I'll leave this as an enhancement request.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44464>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]