Re: balsa and gcc 3.3



On 05/22/2003, Artur Flinta wrote:
> Hi!
> 
> Here is small solution for compiling balsa with gcc 3.3:
> 
> remove -Wsign-promo from configure.in and then regenerate it. Add to 
> compiler flags -fno-strict-aliasing. And that's all 
> :) 			 
> Artur

I'm glad you found a way to get Balsa to compile--but I'm concerned 
about using -fno-strict-aliasing.  I don't understand the concept at 
all, but I get the sense that when the compiler analyzes code using 
strict aliasing, it can optimize in ways that are not otherwise 
possible.

In the present case, it seems that the usage

safe_free((void **) & some_variable);

is the problem.  From the code for safe_free(), it appears that

free(some_variable);
some_variable = NULL;

is exactly equivalent, and presumably doesn't depend on type-punning.  
Perhaps someone with gcc 3.3 could verify this.  On the whole, Balsa 
code is more type-aware than libmutt (which is where safe_free is 
implemented), so with luck we can, without *too* much trouble, adapt 
Balsa to compile under gcc 3.3 without turning off strict aliasing.

Peter



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