Looks like 'pure'.
Also the wording in the recent documentation is a bit different, if you
find it more helpful (gcc-8.1.0):
'malloc'
This tells the compiler that a function is 'malloc'-like, i.e.,
that the pointer P returned by the function cannot alias any other
pointer valid when the function returns, and moreover no pointers
to valid objects occur in any storage addressed by P.
Using this attribute can improve optimization. Functions like
'malloc' and 'calloc' have this property because they return a
pointer to uninitialized or zeroed-out storage. However, functions
like 'realloc' do not have this property, as they can return a
pointer to storage containing pointers.
'pure'
Many functions have no effects except the return value and their
return value depends only on the parameters and/or global
variables. Calls to such functions can be subject to common
subexpression elimination and loop optimization just as an
arithmetic operator would be. These functions should be declared
with the attribute 'pure'. For example,
int square (int) __attribute__ ((pure));
says that the hypothetical function 'square' is safe to call fewer
times than the program says. [...]
On 05/15/2018 10:23 AM, Marcel Hollerbach wrote:
Looking quichly at the definition of those two attributes. They conflict...
Something cannot call malloc when its pure, as the function is not the
same when called twice with the same global and local state ...
Removing pure is enough IMO.
Greetings,
bu5hm4n
i) malloc:
The malloc attribute is used to tell the compiler that a function may be
treated as if any non-NULL pointer it returns cannot alias any other
pointer valid when the function returns and that the memory has
undefined content. This often improves optimization. Standard functions
with this property include malloc and calloc. realloc-like functions do
not have this property as the memory pointed to does not have undefined
content.
ii) pure:
Many functions have no effects except to return a value, and their
return value depends only on the parameters and global variables.
Functions of this kind can be subject to data flow analysis and might be
eliminated.
On 05/15/2018 08:09 AM, Daniel Zaoui wrote:
Hello guys,
After my system update (Arch), I get the following warning (a lot)
during the compilation of EFL:
../src/lib/eina/eina_module.h:233:2: warning: ignoring attribute
'malloc' because it conflicts with attribute 'pure' [-Wattributes]
eina_module_symbol_path_get(const void *symbol, const char
*sub_dir) EINA_PURE EINA_MALLOC EINA_ARG_NONNULL(1, 2);
Someone knows how to deal with that?
Thanks
D2
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel