3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-26 20:52:37 +01:00
pbot/modules/compiler_vm/languages/c89.pm

48 lines
1.1 KiB
Perl
Raw Normal View History

#!/usr/bin/perl
use warnings;
use strict;
package c89;
use parent '_c_base';
sub initialize {
my ($self, %conf) = @_;
$self->{sourcefile} = 'prog.c';
$self->{execfile} = 'prog';
$self->{default_options} = '-Wextra -Wall -Wno-unused -pedantic -Wfloat-equal -Wshadow -std=c89 -lm -Wfatal-errors -fsanitize=alignment,undefined';
$self->{options_paste} = '-fdiagnostics-show-caret';
$self->{options_nopaste} = '-fno-diagnostics-show-caret';
2015-07-17 09:33:04 +02:00
$self->{cmdline} = 'gcc -ggdb -g3 $sourcefile $options -o $execfile';
# $self->{default_options} .= ' -Werror' if defined $self->{nick} && $self->{nick} =~ m/marchelz/i;
2017-04-11 04:24:41 +02:00
$self->{prelude} = <<'END';
#define _XOPEN_SOURCE 9001
#define __USE_XOPEN
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <float.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>
#include <time.h>
#include <stdarg.h>
#include <stddef.h>
#include <prelude.h>
END
}
1;