[sane-devel] compiling with gcc 3.3.4 on OS/2

Franz Bakan Franz Bakan" <fbakan@gmx.net
Tue, 02 Nov 2004 18:38:18 +0100 (CET)


On Thu, 14 Oct 2004 14:00:30 +0200, Henning Meier-Geinitz wrote:

>> I'm trying to build with gcc 3.3.4 and besides other small problems
>> 
>> compiling fails with:
>> 
>> sanei_scsi.c: In function `sanei_scsi_find_devices':
>> sanei_scsi.c:3857: error: assignment of read-only member `str'
...
>> sanei_scsi.c:3864: error: assignment of read-only member `i'
>
>The struct itsself is const so I guess a warning would be ok. I'm not
>sure if the error is correct.
>
>If I remember correctly, that code was changed to avoid error messages
>from gcc some time ago. The assigments to u and i were done in the
>initializer before that.
>
>> I didn't have seen this problem with earlier versions of gcc.
>> 
>> Is there a solution or compiler-flag to solve the problem?
>
>Make the struct non-const? I haven't checked the consequences.

I tried and yes, removing the 'const' helps. It compiles again.

Franz