After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 580310 - cannot pass NULL env to spawn_async()
cannot pass NULL env to spawn_async()
Status: RESOLVED NOTABUG
Product: glibmm
Classification: Bindings
Component: general
2.4.x
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2009-04-26 16:48 UTC by rioch
Modified: 2009-07-06 14:14 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26



Description rioch 2009-04-26 16:48:26 UTC
Please describe the problem:
glib allows you to spawn a process and inherit the parent's environment by passing NULL for the envp parameter. 

  envp : child's environment, or NULL to inherit parent's

Doing this in glibmm results in an error:

  /usr/include/glibmm-2.4/glibmm/arrayhandle.h:83: error: request for member 'begin' in 'cont', which is of non-class type 'const int'



Steps to reproduce:
1. Pass NULL for envp param
2. 
3. 


Actual results:
Compile error.

Expected results:
Error doesn't occur. Parent's environment should be inherited.

Does this happen every time?
Yes.

Other information:
I'm not sure how to work around this.
Comment 1 Daniel Elstner 2009-07-06 14:14:32 UTC
The documentation is auto-generated from the C API documentation and thus sometimes confusing in the manner you experienced.

But you can simply use the other spawn_async() overload which doesn't take the env vector argument: <http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/group__Spawn.html#g0c4e1708989b50fb34266504cc038ee6>