2015-01-15 06:51:17 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
2021-07-11 00:00:22 +02:00
|
|
|
# SPDX-FileCopyrightText: 2021 Pragmatic Software <pragma78@gmail.com>
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2015-01-15 06:51:17 +01:00
|
|
|
use warnings;
|
|
|
|
use strict;
|
|
|
|
|
2022-01-23 16:49:23 +01:00
|
|
|
package Languages::c11;
|
|
|
|
use parent 'Languages::_c_base';
|
2015-01-15 06:51:17 +01:00
|
|
|
|
|
|
|
sub initialize {
|
|
|
|
my ($self, %conf) = @_;
|
|
|
|
|
|
|
|
$self->{sourcefile} = 'prog.c';
|
|
|
|
$self->{execfile} = 'prog';
|
2021-10-20 06:03:34 +02:00
|
|
|
$self->{default_options} = '-Wextra -Wall -Wno-unused -pedantic -Wfloat-equal -Wshadow -std=c11 -lm -Wfatal-errors -fsanitize=alignment,undefined -fsanitize-address-use-after-scope -fno-omit-frame-pointer';
|
2015-01-17 13:41:50 +01:00
|
|
|
$self->{options_paste} = '-fdiagnostics-show-caret';
|
|
|
|
$self->{options_nopaste} = '-fno-diagnostics-show-caret';
|
2022-02-04 22:57:09 +01:00
|
|
|
$self->{cmdline} = 'gcc -gdwarf-2 -g3 $sourcefile $options -o $execfile';
|
2015-01-15 06:51:17 +01:00
|
|
|
|
|
|
|
$self->{prelude} = <<'END';
|
|
|
|
#define _XOPEN_SOURCE 9001
|
|
|
|
#define __USE_XOPEN
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdnoreturn.h>
|
|
|
|
#include <stdalign.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <float.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <complex.h>
|
|
|
|
#include <setjmp.h>
|
|
|
|
#include <wchar.h>
|
|
|
|
#include <wctype.h>
|
|
|
|
#include <tgmath.h>
|
|
|
|
#include <fenv.h>
|
|
|
|
#include <locale.h>
|
|
|
|
#include <iso646.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <uchar.h>
|
2015-04-16 12:10:45 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/types.h>
|
2015-01-15 06:51:17 +01:00
|
|
|
#include <prelude.h>
|
|
|
|
|
|
|
|
END
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|