You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Christian Klinger <ck...@novareto.de> on 2006/06/29 10:48:18 UTC
Compile Error on 64Bit Machine
Hello Apache Developers,
First i´m a poor c programmer.
i´ve a problem with an apache module on an 64 Bit Linux Machine. If i
compile it on a 32 Bit System i got no errors. I hope this is the right
place to ask for help.
I hope someone has a tip for me.
thx christian
here is a example of my code:
(uu is base64 encoded username:passwort)
-------------
char b[MAX_STRING_LEN]
...
apr_snprintf(b, MAX_STRING_LEN, 'BASIC %s', uu);
----------------
if i compile this i got these errors:
mod_auth_tkt.c:1308:35: warning: character constant too long for its type
mod_auth_tkt.c: In function ‘auth_tkt_check’:
mod_auth_tkt.c:1308: warning: passing argument 3 of ‘apr_snprintf’ makes
pointer from integer without a cast
Re: Compile Error on 64Bit Machine
Posted by Christian Klinger <ck...@novareto.de>.
Sorry last night too long now i think it works.
1000 thanks
-christian
> Hi Andreas,
>
> thx for your answer. Maybe i don´t check this but your line looks
> the same as mine.
>
> - christian
>
>> Hi Christian,
>>
>> first, its usually a good idea to post a complete example
>> with a small main() function, this makes it easier
>> to simply cut&paste it it into an editor and run it
>> through the compiler to verify the issue.
>>
>> Then, I suppose that your issue does not have to do
>> anything with 64 bit. You are passing a *character*
>> to the third parameter:
>>
>> apr_snprintf(b, MAX_STRING_LEN, 'BASIC %s', uu);
>>
>> Instead try
>>
>> apr_snprintf(b, MAX_STRING_LEN, "BASIC %s", uu);
>>
>> Best Regards,
>>
>> Andreas
>>
>> Christian Klinger wrote:
>> [...]
>>> here is a example of my code:
>>> (uu is base64 encoded username:passwort)
>>> -------------
>>> char b[MAX_STRING_LEN]
>>> ...
>>> apr_snprintf(b, MAX_STRING_LEN, 'BASIC %s', uu);
>>> ----------------
>>>
>>> if i compile this i got these errors:
>>>
>>> mod_auth_tkt.c:1308:35: warning: character constant too long for its
>>> type
>>> mod_auth_tkt.c: In function ‘auth_tkt_check’:
>>> mod_auth_tkt.c:1308: warning: passing argument 3 of ‘apr_snprintf’ makes
>>> pointer from integer without a cast
>>
>>
>>
>
>
Re: Compile Error on 64Bit Machine
Posted by Christian Klinger <ck...@novareto.de>.
Hi Andreas,
thx for your answer. Maybe i don´t check this but your line looks
the same as mine.
- christian
> Hi Christian,
>
> first, its usually a good idea to post a complete example
> with a small main() function, this makes it easier
> to simply cut&paste it it into an editor and run it
> through the compiler to verify the issue.
>
> Then, I suppose that your issue does not have to do
> anything with 64 bit. You are passing a *character*
> to the third parameter:
>
> apr_snprintf(b, MAX_STRING_LEN, 'BASIC %s', uu);
>
> Instead try
>
> apr_snprintf(b, MAX_STRING_LEN, "BASIC %s", uu);
>
> Best Regards,
>
> Andreas
>
> Christian Klinger wrote:
> [...]
>> here is a example of my code:
>> (uu is base64 encoded username:passwort)
>> -------------
>> char b[MAX_STRING_LEN]
>> ...
>> apr_snprintf(b, MAX_STRING_LEN, 'BASIC %s', uu);
>> ----------------
>>
>> if i compile this i got these errors:
>>
>> mod_auth_tkt.c:1308:35: warning: character constant too long for its type
>> mod_auth_tkt.c: In function ‘auth_tkt_check’:
>> mod_auth_tkt.c:1308: warning: passing argument 3 of ‘apr_snprintf’ makes
>> pointer from integer without a cast
>
>
>
Re: Compile Error on 64Bit Machine
Posted by Andreas Fester <af...@apache.org>.
Hi Christian,
first, its usually a good idea to post a complete example
with a small main() function, this makes it easier
to simply cut&paste it it into an editor and run it
through the compiler to verify the issue.
Then, I suppose that your issue does not have to do
anything with 64 bit. You are passing a *character*
to the third parameter:
apr_snprintf(b, MAX_STRING_LEN, 'BASIC %s', uu);
Instead try
apr_snprintf(b, MAX_STRING_LEN, "BASIC %s", uu);
Best Regards,
Andreas
Christian Klinger wrote:
[...]
> here is a example of my code:
> (uu is base64 encoded username:passwort)
> -------------
> char b[MAX_STRING_LEN]
> ...
> apr_snprintf(b, MAX_STRING_LEN, 'BASIC %s', uu);
> ----------------
>
> if i compile this i got these errors:
>
> mod_auth_tkt.c:1308:35: warning: character constant too long for its type
> mod_auth_tkt.c: In function ‘auth_tkt_check’:
> mod_auth_tkt.c:1308: warning: passing argument 3 of ‘apr_snprintf’ makes
> pointer from integer without a cast