[patch] Eliminate dynamic/variable arrays

Panu Matilainen pmatilai at laiskiainen.org
Thu Jun 15 10:17:45 PDT 2006


On Thu, 15 Jun 2006, Ralf Corsepius wrote:

> 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++;)

Who doesn't :)

Applied, thanks.

 	- Panu -



More information about the Apt-Rpm mailing list