News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

[cpctelera 1.4][sdcc 3.5] stdllib : rand() : warning message at compilation

Started by gryken, 12:27, 08 January 17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gryken

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.

Arnaud

Hello,
the warning is from this function (stdlib.h) :

#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 :
rand() with cpct_rand()

And replace :
#include <stdio.h>
#include <stdlib.h>

with
#include <cpctelera.h>

That all  :D
And more you have saved some bytes in your program because cpctelera functions are highly optimized for CPC


Powered by SMFPacks Menu Editor Mod