1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-27 11:14:42 -05:00

Main: fix warnings in tests

This commit is contained in:
Alex Kotov 2022-02-02 08:09:54 +05:00
parent 03df12697e
commit dbe99b83be
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
7 changed files with 46 additions and 20 deletions

View file

@ -10,8 +10,7 @@ main_freebsd_task:
- pkg install --yes autoconf automake - pkg install --yes autoconf automake
main_build_script: main_build_script:
- ./autogen.sh - ./autogen.sh
# FIXME: -Werror: unknown warning option '-Wno-cast-function-type' - ./configure --enable-tests CFLAGS='-O3'
- ./configure --enable-tests --disable-werror CFLAGS='-O3'
- make - make
- sudo make install - sudo make install
main_test_script: main_test_script:
@ -26,8 +25,7 @@ mruby_freebsd_task:
- unzip mruby-3.0.0.zip - unzip mruby-3.0.0.zip
main_build_script: main_build_script:
- ./autogen.sh - ./autogen.sh
# FIXME: -Werror: unknown warning option '-Wno-cast-function-type' - ./configure CFLAGS='-O3'
- ./configure --disable-werror CFLAGS='-O3'
- make - make
- sudo make install - sudo make install
mruby_test_script: mruby_test_script:
@ -47,8 +45,7 @@ ruby_freebsd_task:
- sudo make install - sudo make install
main_build_script: main_build_script:
- ./autogen.sh - ./autogen.sh
# FIXME: -Werror: unknown warning option '-Wno-cast-function-type' - ./configure CFLAGS='-O3'
- ./configure --disable-werror CFLAGS='-O3'
- make - make
- sudo make install - sudo make install
ruby_build_script: ruby_build_script:
@ -70,8 +67,7 @@ rust_freebsd_task:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
main_build_script: main_build_script:
- ./autogen.sh - ./autogen.sh
# FIXME: -Werror: unknown warning option '-Wno-cast-function-type' - ./configure CFLAGS='-O3'
- ./configure --disable-werror CFLAGS='-O3'
- make - make
- sudo make install - sudo make install
rust_test_script: rust_test_script:

View file

@ -13,12 +13,7 @@ jobs:
matrix: matrix:
# TODO: something is wrong with TCC, Multiboot 2 info tag struct size # TODO: something is wrong with TCC, Multiboot 2 info tag struct size
#cc: ['gcc', 'clang', 'tcc'] #cc: ['gcc', 'clang', 'tcc']
cc: cc: ['gcc', 'clang']
- cc: 'gcc'
werror: ''
- cc: 'clang'
# FIXME: -Werror: unknown warning option '-Wno-cast-function-type'
werror: '--disable-werror'
opt: ['', '-O0', '-O3'] opt: ['', '-O0', '-O3']
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -27,7 +22,7 @@ jobs:
- name: autogen - name: autogen
run: ./autogen.sh run: ./autogen.sh
- name: configure - name: configure
run: ./configure --enable-tests ${{matrix.cc.werror}} CC='${{matrix.cc.cc}}' CFLAGS='${{matrix.opt}}' run: ./configure --enable-tests CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}}'
- name: make - name: make
run: make run: make
- name: check - name: check

View file

@ -5,7 +5,6 @@ AM_CFLAGS = \
-pedantic \ -pedantic \
-Wall \ -Wall \
-Wextra \ -Wextra \
-Wno-cast-function-type \
-I$(top_builddir)/include \ -I$(top_builddir)/include \
-I$(top_srcdir)/include -I$(top_srcdir)/include

View file

@ -5,10 +5,19 @@
#include <kernaux/multiboot2.h> #include <kernaux/multiboot2.h>
#include <assert.h> #include <assert.h>
#include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include "multiboot2_header_example1.h" #include "multiboot2_header_example1.h"
static void my_printf(const char *format, ...)
{
va_list va;
va_start(va, format);
vprintf(format, va);
va_end(va);
}
int main() int main()
{ {
assert(KernAux_Multiboot2_Header_is_valid( assert(KernAux_Multiboot2_Header_is_valid(
@ -17,7 +26,7 @@ int main()
KernAux_Multiboot2_Header_print( KernAux_Multiboot2_Header_print(
(struct KernAux_Multiboot2_Header*)&multiboot2_header_example1, (struct KernAux_Multiboot2_Header*)&multiboot2_header_example1,
(void (*)(const char *format, ...))printf my_printf
); );
return 0; return 0;

View file

@ -5,10 +5,19 @@
#include <kernaux/multiboot2.h> #include <kernaux/multiboot2.h>
#include <assert.h> #include <assert.h>
#include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include "multiboot2_header_example2.h" #include "multiboot2_header_example2.h"
static void my_printf(const char *format, ...)
{
va_list va;
va_start(va, format);
vprintf(format, va);
va_end(va);
}
int main() int main()
{ {
assert(KernAux_Multiboot2_Header_is_valid( assert(KernAux_Multiboot2_Header_is_valid(
@ -17,7 +26,7 @@ int main()
KernAux_Multiboot2_Header_print( KernAux_Multiboot2_Header_print(
&multiboot2_header_example2.multiboot2_header, &multiboot2_header_example2.multiboot2_header,
(void (*)(const char *format, ...))printf my_printf
); );
return 0; return 0;

View file

@ -5,10 +5,19 @@
#include <kernaux/multiboot2.h> #include <kernaux/multiboot2.h>
#include <assert.h> #include <assert.h>
#include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include "multiboot2_info_example1.h" #include "multiboot2_info_example1.h"
static void my_printf(const char *format, ...)
{
va_list va;
va_start(va, format);
vprintf(format, va);
va_end(va);
}
int main() int main()
{ {
assert(KernAux_Multiboot2_Info_is_valid( assert(KernAux_Multiboot2_Info_is_valid(
@ -17,7 +26,7 @@ int main()
KernAux_Multiboot2_Info_print( KernAux_Multiboot2_Info_print(
(struct KernAux_Multiboot2_Info*)multiboot2_info_example1, (struct KernAux_Multiboot2_Info*)multiboot2_info_example1,
(void (*)(const char *format, ...))printf my_printf
); );
return 0; return 0;

View file

@ -5,10 +5,19 @@
#include <kernaux/multiboot2.h> #include <kernaux/multiboot2.h>
#include <assert.h> #include <assert.h>
#include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include "multiboot2_info_example2.h" #include "multiboot2_info_example2.h"
static void my_printf(const char *format, ...)
{
va_list va;
va_start(va, format);
vprintf(format, va);
va_end(va);
}
int main() int main()
{ {
assert(KernAux_Multiboot2_Info_is_valid( assert(KernAux_Multiboot2_Info_is_valid(
@ -17,7 +26,7 @@ int main()
KernAux_Multiboot2_Info_print( KernAux_Multiboot2_Info_print(
&multiboot2_info_example2.multiboot2_info, &multiboot2_info_example2.multiboot2_info,
(void (*)(const char *format, ...))printf my_printf
); );
return 0; return 0;