On Jan 7, 2009, at 2:57 PM, Steven Dake wrote:
> not sure if this patch fixes all your problems, but give it a try.
Yep, that works. Thanks!
> My compiler doesn't give me any warnings with or without patch.
I probably have a few extra warnings on.
Try: -Wcast-qual
>
>
> Regards
> -steve
>
>
> On Wed, 2009-01-07 at 14:34 +0100, Andrew Beekhof wrote:
>> On the topic of logsys, I now noticed a bunch of macros like this
>> one:
>>
>> #define log_printf(lvl, format, args...) \
>> do {
>> \
>> _logsys_log_printf (logsys_subsys_id, (char *) __FUNCTION__, \
>> __FILE__, __LINE__, lvl, format, ##args); \
>> } while(0)
>>
>>
>> __FUNCTION__ is a const and the compiler won't let one cast it away.
>>
>> The compiler still spews out dozens of "warning: cast discards
>> qualifiers from target type" messages (which causes my builds to
>> fail).
>>
>> What can't it be passed in as a const? Surely you're not actually
>> modifying it.
>>
>> Andrew
>>
>> On Jan 7, 2009, at 1:43 PM, Steven Dake wrote:
>>
>>> Yes.
>>>
>>> We can make it optional and use pthread_mutex in its place if the
>>> spin
>>> lock operations aren't present.
>>>
>>> The only reason it is used now is because it is about 4x faster then
>>> mutexes in the use cases of the logsys.
>>>
>>> I wasn't aware of the portability problems.
>>>
>>> Is there a method to test if spin_lock is unavailable on these
>>> platforms? I don't have any of those platforms available to test
>>> on.
>>>
>>> Regards
>>> -steve
>>>
>>>
>>> On Wed, 2009-01-07 at 13:36 +0100, Andrew Beekhof wrote:
>>>> Hi Steve,
>>>>
>>>> Unfortunately the use of pthread_spin_lock by logsys makes corosync
>>>> unusable/uncompilable on a number of platforms including OSX:
>>>>
>>>> http://www.gnu.org/software/gnulib/manual/html_node/pthread_005fspin_005flock.html
>>>>
>>>> Is there an alternative you could use instead?
>>>>
>>>> The full gcc output follows:
>>>> ==== /Users/beekhof/Development/corosync-svn/exec ===
>>>> logsys.c:114: error: syntax error before 'logsys_idx_spinlock'
>>>> logsys.c:114: warning: type defaults to 'int' in declaration of
>>>> 'logsys_idx_spinlock'
>>>> logsys.c:114: warning: data definition has no type or storage class
>>>> logsys.c: In function 'records_reclaim':
>>>> logsys.c:176: warning: implicit declaration of function
>>>> 'pthread_spin_lock'
>>>> logsys.c:205: warning: implicit declaration of function
>>>> 'pthread_spin_unlock'
>>>> logsys.c: In function '_logsys_rec_init':
>>>> logsys.c:567: warning: implicit declaration of function
>>>> 'pthread_spin_init'
>>>> make[1]: *** [logsys.o] Error 1
>>>> make: *** [all] Error 2
>>>>
>>>> _______________________________________________
>>>> Openais mailing list
>>>> [email protected]
>>>> https://lists.linux-foundation.org/mailman/listinfo/openais
>>>
>>
> <const-warnings-removal.patch>
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais