Fix Build Warnings for AArch64 (#2242)

This commit links to issue (#2234).

When cross-compiling for AArch64, using gcc 13.3, you encounter three
warnings types that turn into errors:

- maybe-uninitialized
- stringop-truncation
- strict-aliasing

This commit fixes all the warnings found, in regards to the first two
rules. To resolve the warnigns due to strict-aliasing, I am editing the
CMake build system.

Signed-off-by: Antonios Christidis <a-christidis@ti.com>
This commit is contained in:
Antonios Christidis
2025-02-05 06:58:17 -06:00
committed by GitHub
parent bcfa1f7c26
commit 2031e21a58
30 changed files with 104 additions and 43 deletions

View File

@@ -2415,6 +2415,12 @@ int debug_find_vector_in_image(void *imagePtr, image_descriptor *imageInfo,
(imageInfo->height >> lod) ? (imageInfo->height >> lod) : 1;
depth = (imageInfo->depth >> lod) ? (imageInfo->depth >> lod) : 1;
break;
default:
log_error("ERROR: Invalid imageInfo->type = %d\n", imageInfo->type);
width = 0;
depth = 0;
height = 0;
break;
}
row_pitch = width * get_pixel_size(imageInfo->format);
@@ -3661,6 +3667,11 @@ void copy_image_data(image_descriptor *srcImageInfo,
? (srcImageInfo->height >> src_lod)
: 1;
break;
default:
log_error("ERROR: Invalid srcImageInfo->type = %d\n",
srcImageInfo->type);
src_lod = 0;
break;
}
src_mip_level_offset = compute_mip_level_offset(srcImageInfo, src_lod);
src_row_pitch_lod =
@@ -3707,6 +3718,11 @@ void copy_image_data(image_descriptor *srcImageInfo,
? (dstImageInfo->height >> dst_lod)
: 1;
break;
default:
log_error("ERROR: Invalid dstImageInfo->num_mip_levels = %d\n",
dstImageInfo->num_mip_levels);
dst_lod = 0;
break;
}
dst_mip_level_offset = compute_mip_level_offset(dstImageInfo, dst_lod);
dst_row_pitch_lod =

View File

@@ -348,7 +348,7 @@ cl_int clProtectedImage::Create(cl_context context,
const cl_image_format *fmt, size_t width,
size_t height, size_t depth, size_t arraySize)
{
cl_int error;
cl_int error = 0;
#if defined(__APPLE__)
int protect_pages = 1;
cl_device_id devices[16];