Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: src
Module Name: src
Committed By: rillig
Date: Sat Sep 28 15:51:40 UTC 2024
Modified Files:
src/tests/usr.bin/xlint/lint1: decl_arg.c gcc_attribute_var.c msg_192.c
msg_231.c
src/usr.bin/xlint/lint1: cgram.y debug.c decl.c externs1.h lint1.h
Log Message:
lint: handle __attribute__((__unused__)) for functions and variables
Previously, lint ignored the '__unused' marker, requiring its own /*
ARGSUSED */ marker instead.
Previously, attributes were interpreted as soon as the closing
parenthesis was parsed. For a function definition such as '__unused
static void f(void) {}', this was too early, as the attribute was not
connected to the function, as the function was not parsed yet.
Now, the 'unused' attribute is passed around by the parser, until it is
merged into the declarator where it belongs. Due to an inaccuracy in
the grammar, the 'used' attribute has to be passed through a
parameter_list, even though a parameter list is not related to
attributes. Still, it's better than before.
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/xlint/lint1/decl_arg.c
cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint1/gcc_attribute_var.c
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/msg_192.c
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/msg_231.c
cvs rdiff -u -r1.509 -r1.510 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.404 -r1.405 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.232 -r1.233 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.227 -r1.228 src/usr.bin/xlint/lint1/lint1.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index