On Mon, Aug 03, 2009 at 05:01:25PM +0100, Richard W.M. Jones wrote:
On Mon, Aug 03, 2009 at 04:25:55PM +0100, Matthew Booth wrote:
> + /* Add a device to the list of devices */
> + int add_to_device_list(const char *device) {
> + char dev_path[256];
> + snprintf (dev_path, sizeof dev_path, "/dev/%s", device);
So we really are going for nested functions then.
There is something about nested functions which is bad (in the context
of GCC). I don't recall exactly what it is now. It's something like
it uses stack trampolines, or breaks something ...
This has some details
http://gcc.gnu.org/ml/gcc-help/2008-11/msg00049.html
taking the address of a function causes your executable to get
an executable stack, which is a 'bad thing(tm)'. If you merely
call the function directly you'll seem to be safe
Daniel
--
|: Red Hat, Engineering, London -o-
http://people.redhat.com/berrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org -o-
http://ovirt.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|