2015-01-15 10:21:18 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
use warnings;
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
package clang89;
|
|
|
|
use parent '_c_base';
|
|
|
|
|
|
|
|
sub initialize {
|
|
|
|
my ($self, %conf) = @_;
|
|
|
|
|
|
|
|
$self->{sourcefile} = 'prog.c';
|
|
|
|
$self->{execfile} = 'prog';
|
2019-05-28 18:19:42 +02:00
|
|
|
$self->{default_options} = '-Wextra -Wall -Wno-unused -pedantic -Wfloat-equal -Wshadow -std=c89 -lm -Wfatal-errors -fsanitize=integer,undefined,alignment';
|
2015-01-17 13:41:50 +01:00
|
|
|
$self->{options_paste} = '-fcaret-diagnostics';
|
|
|
|
$self->{options_nopaste} = '-fno-caret-diagnostics';
|
2019-05-28 18:19:42 +02:00
|
|
|
$self->{cmdline} = 'clang -ggdb -g3 $sourcefile $options -o $execfile';
|
2015-01-15 10:21:18 +01:00
|
|
|
|
|
|
|
$self->{prelude} = <<'END';
|
|
|
|
#define _XOPEN_SOURCE 9001
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <locale.h>
|
|
|
|
#include <setjmp.h>
|
|
|
|
#include <signal.h>
|
2015-01-17 13:41:50 +01:00
|
|
|
#include <time.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stddef.h>
|
2015-01-15 10:21:18 +01:00
|
|
|
#include <prelude.h>
|
|
|
|
|
|
|
|
END
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|