tests: Fix warnings about unused parameters.

This commit is contained in:
Simon Ruderich
2013-06-10 15:22:17 +02:00
parent 2f1aa1cdd3
commit afca2864dc
5 changed files with 23 additions and 5 deletions

View File

@@ -24,9 +24,11 @@
#ifdef HAVE___ATTRIBUTE__
# define noinline __attribute__((noinline))
# define always_inline __attribute__((always_inline))
# define unused __attribute__((unused))
#else
# define noinline
# define always_inline
# define unused
#endif
/* Branch prediction information for the compiler. */

View File

@@ -17,15 +17,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include "../src/compiler.h"
int main(int argc, char **argv) {
(void)argv;
int main(int argc, char **argv unused) {
fprintf(stderr, "write to stderr: %d\n", argc);
printf("write to stdout\n");
fflush(stdout);

View File

@@ -17,12 +17,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#define _GNU_SOURCE /* for program_invocation_name */
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <error.h>
#include "../src/compiler.h"
void (*error_print_progname)(void);
@@ -31,7 +36,7 @@ static void print_prognmae(void) {
}
int main(int argc, char **argv) {
int main(int argc unused, char **argv unused) {
program_invocation_name = "./example_error";
error(0, 0, "<message>");

View File

@@ -17,11 +17,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "../src/compiler.h"
#define MAGIC "@RUN_"
#define MAGIC_LENGTH (strlen(MAGIC))
@@ -75,7 +79,7 @@ static void dump(char *argv[]) {
}
int main(int argc, char **argv) {
int main(int argc unused, char **argv) {
char argv0[strlen(argv[0]) + MAGIC_LENGTH + 3 + 1];
char *old_ldpreload = getenv("LD_PRELOAD");

View File

@@ -17,12 +17,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main(int argc, char **argv) {
#include "../src/compiler.h"
int main(int argc unused, char **argv unused) {
pid_t pid;
fprintf(stderr, "Before vfork().\n");