[patch] Eliminate dynamic/variable arrays

Ralf Corsepius rc040203 at freenet.de
Wed Jun 14 20:20:57 PDT 2006


Hi,

The patch below addresses 2 issues in apt-shell:

* Eliminate usage of variable arrays in apt-shell.c
These are non-portable.

Variable arrays are a GCC extension to C++ and will cause some non-c++
compilers to refuse compiling the code (G++ warns about them in higher
warning levels).

I am replacing them with std::vectors by brute force, to keep the risk
of accidentally breaking something low, though using std::string would
be a more elegant approach at least in some cases.

* Replace a dynamically allocated array by a vector.
This patch is a bit stylish, but ... I hate arrays in C++;)

Ralf




-------------- next part --------------
A non-text attachment was scrubbed...
Name: apt-rpm-rc-20060615-1.diff
Type: text/x-patch
Size: 3626 bytes
Desc: not available
URL: <http://lists.laiskiainen.org/pipermail/apt-rpm-laiskiainen.org/attachments/20060615/fc01d4bd/attachment.bin>


More information about the Apt-Rpm mailing list