Author Topic: [cpctelera 1.4][sdcc 3.5] stdllib : rand() : warning message at compilation  (Read 860 times)

0 Members and 1 Guest are viewing this topic.

Offline gryken

  • CPC464
  • **
  • Posts: 7
  • Country: fr
  • Liked: 2
  • Likes Given: 0
Hello,

I'm trying to compile the "pixel01.c", from cpcmania's tutorial :

http://www.cpcmania.com/Docs/Programming/Programming.htm

But, i want to make it from CPCTELERA 1.4, with SDCC 3.5:

After the make, there is a warning :

/share/sdcc/include/stdlib.h:84: warning 85: in function aligned_alloc unreferenced function argument : 'alignment'


But, the DSK is created.
The program is running correctly...

What do you think about this message ?

Thanks for you help.

Gryken.

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 684
  • Country: fr
  • Liked: 601
  • Likes Given: 1230
Hello,
the warning is from this function (stdlib.h) :

Code: [Select]
#if __STDC_VERSION__ >= 201112L
inline void *aligned_alloc(size_t alignment, size_t size)
{
  return malloc(size);
}
#endif

It indicates that alignment is not used, you can ignore the warning.

If you want to totally remove this warning, use only cpctelera functions.

Replace :
Code: [Select]
rand() with
Code: [Select]
cpct_rand()
And replace :
Code: [Select]
#include <stdio.h>
#include <stdlib.h>
with
Code: [Select]
#include <cpctelera.h>
That all  :D
And more you have saved some bytes in your program because cpctelera functions are highly optimized for CPC
« Last Edit: 17:26, 08 January 17 by Arnaud »

Offline gryken

  • CPC464
  • **
  • Posts: 7
  • Country: fr
  • Liked: 2
  • Likes Given: 0
Thanks for the hint.

It works for me.