On 3/6/2019 5:30 AM, [email protected] wrote:
> 
> It essentially comes down to 32 bit and 64 bit differences in data type size.
> If you then specify a format size in a printf operation, it will always 
> generate 
> a warning under one architecture or another.
> Assigning with a (void*) cast, will do so too, hence the making of L1 and L2 
> void * probably

I don't have time to test this in Machinekit, but I've solved these
sort of issues using the intptr_t data type (which changes size based
on the architecture), so something like:

  unsigned intptr_t L1, L2;
  unsigned long L3;

Another option (since intptr_t isn't guaranteed to be available and
I'm not 100% the pointer casts required for fscanf wouldn't throw a
warning) is to make a union and overlap a pointer with an integer
type, eg:

  union foo {
    unsigned long long foo_long;
    void *foo_ptr;
  }

...then use the appropriate type where needed.

-- 
Charles Steinkuehler
[email protected]

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to