PROJECT(uci C)
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
-ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I. -DUCI_PREFIX="${CMAKE_INSTALL_PREFIX}")
+ADD_DEFINITIONS(-Os -Wall -Werror -Wclobbered --std=gnu99 -g3 -I. -DUCI_PREFIX="${CMAKE_INSTALL_PREFIX}")
OPTION(UCI_DEBUG "debugging support" OFF)
OPTION(UCI_DEBUG_TYPECAST "typecast debugging support" OFF)
{
char *sdir;
struct uci_element *e, *tmp;
- bool exists = false;
+ volatile bool exists = false;
UCI_HANDLE_ERR(ctx);
UCI_ASSERT(ctx, dir != NULL);
static int uci_parse_delta(struct uci_context *ctx, FILE *stream, struct uci_package *p)
{
struct uci_parse_context *pctx;
- int changes = 0;
+ volatile int changes = 0;
/* make sure no memory from previous parse attempts is leaked */
uci_cleanup(ctx);
/* returns the number of changes that were successfully parsed */
static int uci_load_delta_file(struct uci_context *ctx, struct uci_package *p, char *filename, FILE **f, bool flush)
{
- FILE *stream = NULL;
- int changes = 0;
+ FILE *volatile stream = NULL;
+ volatile int changes = 0;
UCI_TRAP_SAVE(ctx, done);
stream = uci_open_stream(ctx, filename, NULL, SEEK_SET, flush, false);
{
struct uci_element *e;
char *filename = NULL;
- FILE *f = NULL;
- int changes = 0;
+ FILE *volatile f = NULL;
+ volatile int changes = 0;
if (!p->has_delta)
return 0;
int uci_revert(struct uci_context *ctx, struct uci_ptr *ptr)
{
- char *package = NULL;
- char *section = NULL;
- char *option = NULL;
+ char *volatile package = NULL;
+ char *volatile section = NULL;
+ char *volatile option = NULL;
UCI_HANDLE_ERR(ctx);
uci_expand_ptr(ctx, ptr, false);
int uci_save(struct uci_context *ctx, struct uci_package *p)
{
- FILE *f = NULL;
+ FILE *volatile f = NULL;
char *filename = NULL;
struct uci_element *e, *tmp;
struct stat statbuf;
{
struct uci_package *p = *package;
FILE *f1, *f2 = NULL;
- char *name = NULL;
- char *path = NULL;
+ char *volatile name = NULL;
+ char *volatile path = NULL;
char *filename = NULL;
- bool do_rename = false;
+ volatile bool do_rename = false;
int fd;
if (!p->path) {
return configs;
}
-static struct uci_package *uci_file_load(struct uci_context *ctx, const char *name)
+static struct uci_package *uci_file_load(struct uci_context *ctx,
+ const char *volatile name)
{
struct uci_package *package = NULL;
char *filename;
bool confdir;
- FILE *file = NULL;
+ FILE *volatile file = NULL;
switch (name[0]) {
case '.':
{
/* NB: UCI_INTERNAL use means without delta tracking */
bool internal = ctx && ctx->internal;
- struct uci_option *prev = NULL;
- const char *value2 = NULL;
+ struct uci_option *volatile prev = NULL;
+ const char *volatile value2 = NULL;
UCI_HANDLE_ERR(ctx);