Skip to content

Commit

Permalink
mute format-truncation compile warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyselan committed Aug 10, 2023
1 parent 1e180d7 commit 52caca9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gpuvis_trace_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,12 @@ GPUVIS_EXTERN const char *gpuvis_get_tracefs_filename( char *buf, size_t buflen,

if ( tracefs_dir[ 0 ] )
{
// truncation is ok here
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-truncation"
snprintf( buf, buflen, "%s/%s", tracefs_dir, file );
#pragma GCC diagnostic pop

buf[ buflen - 1 ] = 0;

return buf;
Expand Down

0 comments on commit 52caca9

Please sign in to comment.