I like strict-aliasing warnings, but detection is hard, and the current system is experimental, therefore my post in this forum. You must be aware of the work-in-progress state of this feature, don't be ignorant please.
I hope at least one person appreciates the feedback.
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
double UnitTest2( size_t y , size_t x , void* data )
{
double (*d)[x] = data ; //same problem, no warning
double sum = 0.0 ;
for( size_t i = 0 ; i < y ; i++ )
{
for( size_t j = 0 ; j < x ; j++ )
{
sum = sum + d[i][j] ;
}
}
return sum ;
}
int main( void )
{
double d[2][3] = { { 1 , 2 , 3 } , { 4 , 5 , 6 } } ;
printf("%lf" , UnitTest2( 2 , 3 , d ) ) ;
return 0 ;
}
If I get the time I might post a unit test of aliasing violations( something non-trivial ), to see what gets detected.