summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--env/common.c5
-rw-r--r--include/env_default.h6
2 files changed, 6 insertions, 5 deletions
diff --git a/env/common.c b/env/common.c
index 664d2e688ed..99729ca002c 100644
--- a/env/common.c
+++ b/env/common.c
@@ -247,11 +247,6 @@ char *env_get_default(const char *name)
void env_set_default(const char *s, int flags)
{
- if (sizeof(default_environment) > ENV_SIZE) {
- puts("*** Error - default environment is too large\n\n");
- return;
- }
-
if (s) {
if ((flags & H_INTERACTIVE) == 0) {
printf("*** Warning - %s, "
diff --git a/include/env_default.h b/include/env_default.h
index a6724719eca..23430dc70d7 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -121,3 +121,9 @@ const char default_environment[] = {
}
#endif
};
+
+#if !defined(USE_HOSTCC) && !defined(DEFAULT_ENV_INSTANCE_EMBEDDED)
+#include <env_internal.h>
+static_assert(sizeof(default_environment) <= ENV_SIZE,
+ "Default environment is too large");
+#endif