From 72cca8d7838402eb436f1403d4c29dee46db62a1 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 5 Jul 2012 18:19:38 +0300 Subject: [PATCH] Replace #warning with the standard #error. --- generator/nanopb_generator.py | 7 ++----- pb.h | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py index 1925167..1923cc1 100644 --- a/generator/nanopb_generator.py +++ b/generator/nanopb_generator.py @@ -420,8 +420,8 @@ def generate_header(dependencies, headername, enums, messages): if largest_count > 64: yield '\n/* Check that missing required fields will be properly detected */\n' yield '#if PB_MAX_REQUIRED_FIELDS < %d\n' % largest_count - yield '#warning Properly detecting missing required fields in %s requires \\\n' % largest_msg.name - yield ' setting PB_MAX_REQUIRED_FIELDS to %d or more.\n' % largest_count + yield '#error Properly detecting missing required fields in %s requires \\\n' % largest_msg.name + yield ' setting PB_MAX_REQUIRED_FIELDS to %d or more.\n' % largest_count yield '#endif\n' worst = 0 @@ -438,9 +438,6 @@ def generate_header(dependencies, headername, enums, messages): if worst > 255 or checks: yield '\n/* Check that field information fits in pb_field_t */\n' - yield '/* (Largest message has %d fields' % worst - if checks: yield ' and submessages have to be checked at compile-time.' - yield ') */\n' if worst < 65536: yield '#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)\n' diff --git a/pb.h b/pb.h index 61696a4..4983d06 100644 --- a/pb.h +++ b/pb.h @@ -34,8 +34,7 @@ #endif #if PB_MAX_REQUIRED_FIELDS < 64 -#warning You should not lower PB_MAX_REQUIRED_FIELDS from the default value (64). \ - The automatic checks against too low value will not be active. +#error You should not lower PB_MAX_REQUIRED_FIELDS from the default value (64). #endif /* List of possible field types. These are used in the autogenerated code. -- 2.16.6