You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Samisa Abeysinghe <sa...@wso2.com> on 2008/02/19 17:03:03 UTC

Windows build break

mime_parser.c
..\..\axiom\src\attachments\mime_parser.c(118) : error C2057: expected 
constant expression
..\..\axiom\src\attachments\mime_parser.c(118) : error C2466: cannot 
allocate an array of constant size 0
..\..\axiom\src\attachments\mime_parser.c(118) : error C2133: 
'buf_array' : unknown size
..\..\axiom\src\attachments\mime_parser.c(119) : error C2057: expected 
constant expression
..\..\axiom\src\attachments\mime_parser.c(119) : error C2466: cannot 
allocate an array of constant size 0
..\..\axiom\src\attachments\mime_parser.c(119) : error C2133: 
'len_array' : unknown size


Samisa...

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: Windows build break

Posted by Samisa Abeysinghe <sa...@wso2.com>.
It works now, thanks for the fixes.

Samisa...

Senaka Fernando wrote:
> Hi all,
>
> Fixed minor issue in http_transport_utils.c, as atoi() needs stdlib.h, now
> the build is back to normal on Windows with no breaks. This includes
> mod_axis2 (apache/iis) as well.
>
> Regards,
> Senaka
>
>   
>> Sorry it is my fault. In linux it didn't give any error even with
>> Werror.
>>
>> Fixed it to allocate the two arrays dynamically.
>>
>> On Tue, 2008-02-19 at 21:41 +0530, Samisa Abeysinghe wrote:
>>     
>>> Samisa Abeysinghe wrote:
>>>       
>>>> mime_parser.c
>>>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2057: expected
>>>> constant expression
>>>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2466: cannot
>>>> allocate an array of constant size 0
>>>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2133:
>>>> 'buf_array' : unknown size
>>>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2057: expected
>>>> constant expression
>>>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2466: cannot
>>>> allocate an array of constant size 0
>>>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2133:
>>>> 'len_array' : unknown size
>>>>         
>>> I also think that there is a logical error in this code:
>>>
>>> axis2_char_t *buf_array[mime_parser->max_chunk_buffers];
>>>     int len_array[mime_parser->max_chunk_buffers];
>>>
>>> Should the two arrays be of the size max_chunk_buffers?
>>>       
>> Yes , but the thing is max_chunk_buffers is not a constant it is
>> configurable.
>>
>>     
>>> And the syntax error is because the static variable is declared with
>>> variable size. Should use a dynamic allocation.
>>>       
>> Changed to use dynamic allocation. Please check now.
>>
>>     
>>> Samisa...
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: Windows build break

Posted by Senaka Fernando <se...@wso2.com>.
Hi all,

Fixed minor issue in http_transport_utils.c, as atoi() needs stdlib.h, now
the build is back to normal on Windows with no breaks. This includes
mod_axis2 (apache/iis) as well.

Regards,
Senaka

> Sorry it is my fault. In linux it didn't give any error even with
> Werror.
>
> Fixed it to allocate the two arrays dynamically.
>
> On Tue, 2008-02-19 at 21:41 +0530, Samisa Abeysinghe wrote:
>> Samisa Abeysinghe wrote:
>> > mime_parser.c
>> > ..\..\axiom\src\attachments\mime_parser.c(118) : error C2057: expected
>> > constant expression
>> > ..\..\axiom\src\attachments\mime_parser.c(118) : error C2466: cannot
>> > allocate an array of constant size 0
>> > ..\..\axiom\src\attachments\mime_parser.c(118) : error C2133:
>> > 'buf_array' : unknown size
>> > ..\..\axiom\src\attachments\mime_parser.c(119) : error C2057: expected
>> > constant expression
>> > ..\..\axiom\src\attachments\mime_parser.c(119) : error C2466: cannot
>> > allocate an array of constant size 0
>> > ..\..\axiom\src\attachments\mime_parser.c(119) : error C2133:
>> > 'len_array' : unknown size
>>
>> I also think that there is a logical error in this code:
>>
>> axis2_char_t *buf_array[mime_parser->max_chunk_buffers];
>>     int len_array[mime_parser->max_chunk_buffers];
>>
>> Should the two arrays be of the size max_chunk_buffers?
> Yes , but the thing is max_chunk_buffers is not a constant it is
> configurable.
>
>> And the syntax error is because the static variable is declared with
>> variable size. Should use a dynamic allocation.
> Changed to use dynamic allocation. Please check now.
>
>>
>> Samisa...
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: [Axis2] mime parser [was: Re: Windows build break]

Posted by Manjula Peiris <ma...@wso2.com>.
On Wed, 2008-02-20 at 19:11 +0530, Manjula Peiris wrote:
> On Wed, 2008-02-20 at 09:33 +0530, Samisa Abeysinghe wrote:
> > Manjula,
> >     Did you test this with smaller buffer size, no of buffrs vs. larger 
> > file.
> >     I mean 1MB buffer * 2 buffers with a 3MB file?
> 
> In the current implementation it is not handled. I will fix it to put an
> error to the log. since by default the parameters are commented and can
> handle up to 1000MB this won't be a big issue.

Fixed to put an error to the log.

> 
> -Manjula.
> 
> > 
> >     I did not test, but just curious.
> > 
> > Thanks,
> > Samisa...
> > 
> > Manjula Peiris wrote:
> > > Sorry it is my fault. In linux it didn't give any error even with
> > > Werror.
> > >
> > > Fixed it to allocate the two arrays dynamically.
> > >
> > > On Tue, 2008-02-19 at 21:41 +0530, Samisa Abeysinghe wrote:
> > >   
> > >> Samisa Abeysinghe wrote:
> > >>     
> > >>> mime_parser.c
> > >>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2057: expected 
> > >>> constant expression
> > >>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2466: cannot 
> > >>> allocate an array of constant size 0
> > >>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2133: 
> > >>> 'buf_array' : unknown size
> > >>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2057: expected 
> > >>> constant expression
> > >>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2466: cannot 
> > >>> allocate an array of constant size 0
> > >>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2133: 
> > >>> 'len_array' : unknown size
> > >>>       
> > >> I also think that there is a logical error in this code:
> > >>
> > >> axis2_char_t *buf_array[mime_parser->max_chunk_buffers];
> > >>     int len_array[mime_parser->max_chunk_buffers];
> > >>
> > >> Should the two arrays be of the size max_chunk_buffers?
> > >>     
> > > Yes , but the thing is max_chunk_buffers is not a constant it is
> > > configurable.
> > >
> > >   
> > >> And the syntax error is because the static variable is declared with 
> > >> variable size. Should use a dynamic allocation.
> > >>     
> > > Changed to use dynamic allocation. Please check now.
> > >
> > >   
> > >> Samisa...
> > >>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> > >> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
> > >>
> > >>     
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-c-dev-help@ws.apache.org
> > >
> > >
> > >
> > >   
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-c-dev-help@ws.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: [Axis2] mime parser [was: Re: Windows build break]

Posted by Manjula Peiris <ma...@wso2.com>.
On Wed, 2008-02-20 at 09:33 +0530, Samisa Abeysinghe wrote:
> Manjula,
>     Did you test this with smaller buffer size, no of buffrs vs. larger 
> file.
>     I mean 1MB buffer * 2 buffers with a 3MB file?

In the current implementation it is not handled. I will fix it to put an
error to the log. since by default the parameters are commented and can
handle up to 1000MB this won't be a big issue.

-Manjula.

> 
>     I did not test, but just curious.
> 
> Thanks,
> Samisa...
> 
> Manjula Peiris wrote:
> > Sorry it is my fault. In linux it didn't give any error even with
> > Werror.
> >
> > Fixed it to allocate the two arrays dynamically.
> >
> > On Tue, 2008-02-19 at 21:41 +0530, Samisa Abeysinghe wrote:
> >   
> >> Samisa Abeysinghe wrote:
> >>     
> >>> mime_parser.c
> >>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2057: expected 
> >>> constant expression
> >>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2466: cannot 
> >>> allocate an array of constant size 0
> >>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2133: 
> >>> 'buf_array' : unknown size
> >>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2057: expected 
> >>> constant expression
> >>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2466: cannot 
> >>> allocate an array of constant size 0
> >>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2133: 
> >>> 'len_array' : unknown size
> >>>       
> >> I also think that there is a logical error in this code:
> >>
> >> axis2_char_t *buf_array[mime_parser->max_chunk_buffers];
> >>     int len_array[mime_parser->max_chunk_buffers];
> >>
> >> Should the two arrays be of the size max_chunk_buffers?
> >>     
> > Yes , but the thing is max_chunk_buffers is not a constant it is
> > configurable.
> >
> >   
> >> And the syntax error is because the static variable is declared with 
> >> variable size. Should use a dynamic allocation.
> >>     
> > Changed to use dynamic allocation. Please check now.
> >
> >   
> >> Samisa...
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
> >>
> >>     
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-c-dev-help@ws.apache.org
> >
> >
> >
> >   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[Axis2] mime parser [was: Re: Windows build break]

Posted by Samisa Abeysinghe <sa...@wso2.com>.
Manjula,
    Did you test this with smaller buffer size, no of buffrs vs. larger 
file.
    I mean 1MB buffer * 2 buffers with a 3MB file?

    I did not test, but just curious.

Thanks,
Samisa...

Manjula Peiris wrote:
> Sorry it is my fault. In linux it didn't give any error even with
> Werror.
>
> Fixed it to allocate the two arrays dynamically.
>
> On Tue, 2008-02-19 at 21:41 +0530, Samisa Abeysinghe wrote:
>   
>> Samisa Abeysinghe wrote:
>>     
>>> mime_parser.c
>>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2057: expected 
>>> constant expression
>>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2466: cannot 
>>> allocate an array of constant size 0
>>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2133: 
>>> 'buf_array' : unknown size
>>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2057: expected 
>>> constant expression
>>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2466: cannot 
>>> allocate an array of constant size 0
>>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2133: 
>>> 'len_array' : unknown size
>>>       
>> I also think that there is a logical error in this code:
>>
>> axis2_char_t *buf_array[mime_parser->max_chunk_buffers];
>>     int len_array[mime_parser->max_chunk_buffers];
>>
>> Should the two arrays be of the size max_chunk_buffers?
>>     
> Yes , but the thing is max_chunk_buffers is not a constant it is
> configurable.
>
>   
>> And the syntax error is because the static variable is declared with 
>> variable size. Should use a dynamic allocation.
>>     
> Changed to use dynamic allocation. Please check now.
>
>   
>> Samisa...
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: Windows build break

Posted by Manjula Peiris <ma...@wso2.com>.
Sorry it is my fault. In linux it didn't give any error even with
Werror.

Fixed it to allocate the two arrays dynamically.

On Tue, 2008-02-19 at 21:41 +0530, Samisa Abeysinghe wrote:
> Samisa Abeysinghe wrote:
> > mime_parser.c
> > ..\..\axiom\src\attachments\mime_parser.c(118) : error C2057: expected 
> > constant expression
> > ..\..\axiom\src\attachments\mime_parser.c(118) : error C2466: cannot 
> > allocate an array of constant size 0
> > ..\..\axiom\src\attachments\mime_parser.c(118) : error C2133: 
> > 'buf_array' : unknown size
> > ..\..\axiom\src\attachments\mime_parser.c(119) : error C2057: expected 
> > constant expression
> > ..\..\axiom\src\attachments\mime_parser.c(119) : error C2466: cannot 
> > allocate an array of constant size 0
> > ..\..\axiom\src\attachments\mime_parser.c(119) : error C2133: 
> > 'len_array' : unknown size
> 
> I also think that there is a logical error in this code:
> 
> axis2_char_t *buf_array[mime_parser->max_chunk_buffers];
>     int len_array[mime_parser->max_chunk_buffers];
> 
> Should the two arrays be of the size max_chunk_buffers?
Yes , but the thing is max_chunk_buffers is not a constant it is
configurable.

> And the syntax error is because the static variable is declared with 
> variable size. Should use a dynamic allocation.
Changed to use dynamic allocation. Please check now.

> 
> Samisa...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: Windows build break

Posted by Senaka Fernando <se...@wso2.com>.
Hi Samisa,

After I removed the warnings on Windows, to make sure we don't repeat the
same mistakes over and over, and to ensure that we make it a point to
check for warnings on windows, I have set the warn to error flag on
Windows, as well as setting the warning level to 3. Therefore, making sure
that a file builds with gcc on Unix does not guarantee that you wont see
build breaks on Windows. We rather not remove this warn to error flag, and
must only remove it when we pack. Therefore it might be a common scenario
for windows developers to see build breaks. However, it would be a
different scenario for users, who would rather not see at least a warning.
And, Dinesh please make it a point to remove the /WX flags when you pack,
at least until we figure out how to remove it using our dist scripts.

Regards,
Senaka

> Samisa Abeysinghe wrote:
>> mime_parser.c
>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2057: expected
>> constant expression
>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2466: cannot
>> allocate an array of constant size 0
>> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2133:
>> 'buf_array' : unknown size
>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2057: expected
>> constant expression
>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2466: cannot
>> allocate an array of constant size 0
>> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2133:
>> 'len_array' : unknown size
>
> I also think that there is a logical error in this code:
>
> axis2_char_t *buf_array[mime_parser->max_chunk_buffers];
>     int len_array[mime_parser->max_chunk_buffers];
>
> Should the two arrays be of the size max_chunk_buffers?
>
> And the syntax error is because the static variable is declared with
> variable size. Should use a dynamic allocation.
>
> Samisa...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: Windows build break

Posted by Samisa Abeysinghe <sa...@wso2.com>.
Samisa Abeysinghe wrote:
> mime_parser.c
> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2057: expected 
> constant expression
> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2466: cannot 
> allocate an array of constant size 0
> ..\..\axiom\src\attachments\mime_parser.c(118) : error C2133: 
> 'buf_array' : unknown size
> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2057: expected 
> constant expression
> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2466: cannot 
> allocate an array of constant size 0
> ..\..\axiom\src\attachments\mime_parser.c(119) : error C2133: 
> 'len_array' : unknown size

I also think that there is a logical error in this code:

axis2_char_t *buf_array[mime_parser->max_chunk_buffers];
    int len_array[mime_parser->max_chunk_buffers];

Should the two arrays be of the size max_chunk_buffers?

And the syntax error is because the static variable is declared with 
variable size. Should use a dynamic allocation.

Samisa...


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org