On Sun, May 18, 2014 at 01:24:11PM +0200, Patrik Lundin wrote:
> 
> I guess I will have to look into how to disabled -pedantic in the build
> then.
> 

Disabling -pedantic was easy to do at configure time, using
--disable-pedantic. Now I have started looking at the remaining
warnings.

I am constantly debating with myself which group I should talk to first
regarding the following questions, but since these are not thrown on
the comparision Linux box I'll start in this end:

First up is this one:
===
pin.c: In function 'hsm_shm_open':
pin.c:209: warning: comparison between signed and unsigned
===

This is caused by comparing a size_t variable to shm_segsz which
according to shmctl(2) on OpenBSD is an int. Reading the same man page
on the Ubuntu box shows that shm_segsz is considerd to be type size_t
there.

I guess I can fix this by casting shm_segsz to an unsigned int, does
that sound reasonable?

Next we have this one:
===
hsmspeed.c:38:1: warning: "PTHREAD_THREADS_MAX" redefined
In file included from hsmspeed.c:33:
/usr/include/pthread.h:55:1: warning: this is the location of the
previous definition
===

It seems the Linux box just has this to say:
/* We have no predefined limit on the number of threads.  */
#undef PTHREAD_THREADS_MAX

While OpenBSD sets it to a very big value:
#define PTHREAD_THREADS_MAX ULONG_MAX

The code itself sets it to 2048, way less than the default. I guess
having a more conservative setting is not a problem. Maby I should just
leave this warning as is?

Third and final (for now):
===
hsmspeed.c: In function 'sign':
hsmspeed.c:120: warning: control reaches end of non-void function
===

This warning bothers me somewhat, the function is declared in the
following way:
void * sign (void *arg)

It is passed to pthread_create() which is probably why it is a pointer
function.  

I am not sure why the Linux box does not say anything about this. My
current idea is that the function should just have a dummy "return
NULL;" after the call to pthread_exit(). Any ideas?

Regards,
Patrik Lundin

Reply via email to