[haiku-gsoc] Re: Licensing questions

  • From: Vivek Roy <vivekroyandroid@xxxxxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Sun, 11 Jun 2017 19:25:24 +0530

Another thing to ask:

FreeBSD's linuxkpi/asm/atomic.h have atomic_add, atomic_sub etc. Those
implementations are slightly different from those in SupportDefs.h (order
of variables reversed I believe).

In that case should I just change the names of these ones to linux_* and
point them to the SupportDefs ones? (In that case we will have to change it
everywhere to have a linux_ prefix wherever these functions are being
called)

On 11-Jun-2017 5:59 PM, "Vivek Roy" <vivekroyandroid@xxxxxxxxx> wrote:

Up next, couple of warnings.

warning: implicit declaration of function 'vsnprintf' [-Wimplicit-function-
declaration]
warning: implicit declaration of function 'strtouq' [-Wimplicit-function-
declaration]
warning: implicit declaration of function 'strtoq' [-Wimplicit-function-
declaration]
warning: implicit declaration of function 'strtoul' [-Wimplicit-function-
declaration]
warning: implicit declaration of function 'strtol' [-Wimplicit-function-
declaration]
warning: implicit declaration of function 'ppsratecheck'
[-Wimplicit-function-declaration]

For vsnprintf we can import stdio.h
For strtouq, strtoq, strtoul and strtol we have files in posix/stdlib
Finally for ppsratecheck we need time.h from freebsd

Which of the above warnings can/should we ignore?


On Sun, Jun 11, 2017 at 5:00 PM, Vivek Roy <vivekroyandroid@xxxxxxxxx>
wrote:

I tried with bsd/sys/cdefs.h but it wasn't working. But having a macro
defined as Hamish said worked. Thanks again Hamish.

On 11-Jun-2017 2:35 AM, "Hamish Morrison" <hamishm53@xxxxxxxxx> wrote:

On 09/06/2017 18:03, Vivek Roy wrote:

Yet again, in types.h there is strictly rcu_head where they have used
__aligned(size of(void *))

I can see that __aligned is defined in posix/arch and
compat/freebsd_network

I haven't included any of those and am getting an error "expected
declaration specifiers or '...' before 'sizeof' "
A Google search gave me possible reasons being, syntax errors and
circular dependencies. I checked for both, found none.
Help?


__aligned is just a macro that tells the compiler that the type in
question aught to be aligned on the boundary given (in this case given the
same alignment as a pointer). Typically fundamental types will be aligned
on their size (an int on a 4 byte boundary, longs on 8 byte boundaries,
etc). But using a directive like this you can force alignment to a larger
boundary.

It will expand to some compiler-dependent directive for configuring
alignment e.g. for gcc it would be something like:

__attribute__((aligned(sizeof(void*))))

Since we only build with gcc you could just replace this with the above
(I believe clang also supports this syntax).

Or you could define a macro somewhere e.g.

#define __aligned(x) __attribute__((aligned(x)))



Other related posts: