Skip to content

Instantly share code, notes, and snippets.

#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int
main(void)
{
char *p;
random:~/devel/local/test$ gcc -Og -std=gnu2x -Wall -Wextra -Werror -c -o autoconst.o autoconst.c
autoconst.c: In function ‘test’:
autoconst.c:12:18: error: passing argument 1 of ‘potemkin’ from incompatible pointer type [-Werror=incompatible-pointer-types]
12 | potemkin(data0);
| ^~~~~
| |
| char **
autoconst.c:6:35: note: expected ‘const char **’ but argument is of type ‘char **’
6 | extern void potemkin(const char **data);
| ~~~~~~~~~~~~~^~~~
@vathpela
vathpela / is-const.c
Created May 29, 2021 18:10
is-const tester
#include <stdbool.h>
#include <stdio.h>
#define is_const(a) \
_Generic((a), \
const typeof(a): true, \
default: false)
int
main(void)
exclude=texlive-12many
exclude=texlive-2up
exclude=texlive-ESIEEcv
exclude=texlive-GS1
exclude=texlive-HA-prosper
exclude=texlive-IEEEconf
exclude=texlive-IEEEtran
exclude=texlive-SIstyle
exclude=texlive-SIunits
exclude=texlive-Tabbing
random:~/devel/github.com/efivar/security$ LD_LIBRARY_PATH=$PWD/src ./src/efisecdb -o out.db --type sha256 --owner-guid 0223eddb-9079-4388-af77-2d65b1c35d3b --add -h c97299e7e7dc5d1e29d72fa7c7a9da470c8c5d181beb553ebdb98d385653aa22 -h 38d2ed97bded4da4ba58676cf7ae7da77add8fefbf7eb1248757209fad9dabfc
random:~/devel/github.com/efivar/security$ LD_LIBRARY_PATH=$PWD/src ./src/efisecdb --dump --annotate -i out.db
00000000 26 16 c4 c1 4c 50 92 40 ac a9 41 f9 36 93 43 28 |&...LP.@..A.6.C(| esl[0].signature_type = {sha256}
00000010 7c 00 00 00 ||...| esl[0].signature_list_size = 124
00000014 00 00 00 00 |....| esl[0].signature_header_size = 0
00000018 30 00 00 00 |0...| esl[0].signature_size = 48
0000001c esl[0].signature_header (end:0x0000001c)
0000001c
#include "efi_time.h"
#include <time.h>
char *
efi_strptime(const char *s, const char *format, efi_time_t *time)
{
struct tm tm;
char *end;
if (!s || !format || !time) {
%setup -n efivar-38 -q
/usr/bin/git init -q
/usr/bin/git config user.name "rpm-build"
/usr/bin/git config user.email "<rpm-build>"
/usr/bin/git add .
/usr/bin/git commit -q --allow-empty -a\
--author "rpm-build <rpm-build>" -m "efivar-38 base"
%setup -n edk2-edk2-stable201905 -q
/usr/bin/git init -q
/usr/bin/git config user.name "rpm-build"
/usr/bin/git config user.email "<rpm-build>"
/usr/bin/git add .
/usr/bin/git commit -q --allow-empty -a\
--author "rpm-build <rpm-build>" -m "edk2-20190501stable base"
@vathpela
vathpela / grub-https.cfg
Last active October 29, 2020 10:21
grub-https.cfg
set default="0"
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
insmod all_video
}
@vathpela
vathpela / 0001-dammit.patch
Last active April 26, 2022 18:26
Fix coverity builds with any gcc in modern history...
From edbb3b49c57f6d33e0b3db1ec87fe93d596f3560 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 9 Nov 2020 15:16:21 -0500
Subject: [PATCH] dammit
---
bin/{cov-emit => cov-emit-real} | Bin
bin/cov-emit | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+)
rename bin/{cov-emit => cov-emit-real} (100%)