Skip to content

Commit

Permalink
compiler: don't assume that ATTRIBUTE_UNUSED is defined
Browse files Browse the repository at this point in the history
Change-Id: Ia798b779cacd0d53edf4ed2e19c08ee0d07c7969
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/604075
Reviewed-by: Ian Lance Taylor <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
  • Loading branch information
ianlancetaylor authored and Ian Lance Taylor committed Aug 7, 2024
1 parent 5f6fae5 commit 6aa463f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion go/lex.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
#include "operator.h"
#include "go-linemap.h"

#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# define GO_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#else
# define GO_ATTRIBUTE_UNUSED
#endif

struct Unicode_range;

// The keywords. These must be in sorted order, other than
Expand Down Expand Up @@ -561,7 +567,7 @@ class Lex
gather_embed(const char*, const char*);

// The input file name.
const char* input_file_name_ ATTRIBUTE_UNUSED;
const char* input_file_name_ GO_ATTRIBUTE_UNUSED;
// The input file.
FILE* input_file_;
// The object used to keep track of file names and line numbers.
Expand Down

0 comments on commit 6aa463f

Please sign in to comment.