Skip to content

Commit

Permalink
Fix Unused Variable Error
Browse files Browse the repository at this point in the history
Summary:
D68874718 causes some build issues (see https://www.internalfb.com/intern/test/562950120027900?ref_report_id=0 for an example) because the `inOutSpec` variable is not referenced in the function.

Adding the `[[maybe_unused]]` fixes this with the one test I ran, but I'll need CI to verify everything else. Let's use the macro `MAYBE_UNUSED` to be sure that this fix is supported by all compilers.

Differential Revision: D68985760

fbshipit-source-id: d3894c2e6c20055d6f512c16bd69dd47b7ac99e4
  • Loading branch information
Georges Berenger authored and facebook-github-bot committed Feb 1, 2025
1 parent 30ada76 commit c347875
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vrs/WriteFileHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#pragma once

#include <vrs/os/CompilerAttributes.h>

#include "FileHandler.h"

namespace vrs {
Expand Down Expand Up @@ -77,7 +79,7 @@ class WriteFileHandler : public FileHandler {
/// @param inOutSpec: file spec used for the file creation, that will be passed to a
/// DiskFile's create(inOutSpec) to create the head file,
/// and to createSplitFile(inOutSpec, options) to create the body file.
virtual void addSplitHead(FileSpec& inOutSpec) {}
virtual void addSplitHead(MAYBE_UNUSED FileSpec& inOutSpec) {}

/// Tell if modifying files is supported by this FileHandler implementation.
/// @return True if file modification and creation is supported.
Expand Down

0 comments on commit c347875

Please sign in to comment.