Lumiera  0.pre.03
»edit your freedom«
vgsuppression.c
Go to the documentation of this file.
1 /*
2  vgsuppression.c - Helper program to generate valgrind suppression files
3 
4  Copyright (C) Lumiera.org
5  2008, Christian Thaeter <ct@pipapo.org>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21 
31 /*
32  just place any problematic calls where valgrind whines about in main (with comments please)
33 */
34 
35 #include "lib/tmpbuf.h"
36 #include <stdint.h>
37 
38 typedef const char* lumiera_err;
40 
42 lumiera_error_get (void);
43 
44 lumiera_err
45 lumiera_error_set (lumiera_err, const char*);
46 
47 lumiera_err
48 lumiera_error (void);
49 
50 
51 int
52 main ()
53 {
54  /* debian etch glibc is lazy about cleaning up TLS */
57 
58  /* tempbufs aren't freed by design */
59  lumiera_tmpbuf_snprintf (SIZE_MAX, "everyone loves c-strings");
60 
61  /* lumiera_error_get() mallocs a LumieraErrorcontext for each thread */
62  lumiera_error_get();
63  lumiera_error_set("dummy","dummy");
64  lumiera_error();
65 
66  return 0;
67 }
void * lumiera_tmpbuf_provide(size_t size)
Query a thread local tmpbuf.
Definition: tmpbuf.c:89
int main(int argc, const char *argv[])
run all tests or any single test specified in the first command line argument.
Definition: testrunner.cpp:47
Round robin temporary buffers.
void lumiera_tmpbuf_freeall(void)
free all buffers associated with this thread.
Definition: tmpbuf.c:73
Holding error and some context data.
Definition: error-state.c:56
lumiera_err lumiera_error_set(lumiera_err, const char *)
Set error state for the current thread.
Definition: error-state.c:105
lumiera_err lumiera_error(void)
Get and clear current error state.
Definition: error-state.c:124
char * lumiera_tmpbuf_snprintf(size_t size, const char *fmt,...)
Construct a string in a tmpbuf.
Definition: tmpbuf.c:125