+2015-11-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/misc.c: Move global variables to the top of the file.
+ (gnat_handle_option): Remove obsolete ATTRIBUTE_UNUSED markers.
+ (gnat_init_options): Minor tweak.
+ (gnat_post_options): Set -fstrict-overflow if not done by the user.
+ (internal_error_function): Minor reformatting.
+
2015-11-18 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Use case #1
2015-11-18 Hristian Kirtchev <kirtchev@adacore.com>
PR ada/66242
-
* exp_ch3.adb (Default_Initialize_Object): Reimplemented. Abort
defer / undefer pairs are now encapsulated in a block with
an AT END handler. Partial finalization now takes restriction
2015-03-01 Arnaud Charlet <charlet@adacore.com>
PR ada/65259
-
* doc/gnat_ugn/gnat_project_manager.rst,
doc/gnat_ugn/platform_specific_information.rst: Remove reference to
image, too troublesome with texi format.
unsigned int save_argc;
const char **save_argv;
-/* GNAT argc and argv. */
+/* GNAT argc and argv generated by the binder for all Ada programs. */
extern int gnat_argc;
-extern char **gnat_argv;
+extern const char **gnat_argv;
+
+/* Ada code requires variables for these settings rather than elements
+ of the global_options structure because they are imported. */
+int gnat_encodings = 0;
+
+#undef optimize
+int optimize;
+
+#undef optimize_size
+int optimize_size;
+
+#undef flag_compare_debug
+int flag_compare_debug;
+
+#undef flag_short_enums
+int flag_short_enums;
+
+#undef flag_stack_check
+enum stack_check_type flag_stack_check = NO_STACK_CHECK;
#ifdef __cplusplus
extern "C" {
are marked as Ada-specific. Return true on success or false on failure. */
static bool
-gnat_handle_option (size_t scode, const char *arg ATTRIBUTE_UNUSED, int value,
- int kind ATTRIBUTE_UNUSED, location_t loc ATTRIBUTE_UNUSED,
- const struct cl_option_handlers *handlers ATTRIBUTE_UNUSED)
+gnat_handle_option (size_t scode, const char *arg, int value, int kind,
+ location_t loc, const struct cl_option_handlers *handlers)
{
enum opt_code code = (enum opt_code) scode;
Ada_handle_option_auto (&global_options, &global_options_set,
scode, arg, value,
- gnat_option_lang_mask (), kind,
- loc, handlers, global_dc);
+ gnat_option_lang_mask (), kind, loc,
+ handlers, global_dc);
return true;
}
??? back_end.adb should not rely on this; instead, it should work with
decoded options without such reparsing, to ensure consistency in how
options are decoded. */
- unsigned int i;
-
save_argv = XNEWVEC (const char *, 2 * decoded_options_count + 1);
save_argc = 0;
- for (i = 0; i < decoded_options_count; i++)
+ for (unsigned int i = 0; i < decoded_options_count; i++)
{
size_t num_elements = decoded_options[i].canonical_option_num_elements;
}
save_argv[save_argc] = NULL;
- gnat_argv = (char **) xmalloc (sizeof (save_argv[0]));
- gnat_argv[0] = xstrdup (save_argv[0]); /* name of the command */
+ /* Pass just the name of the command through the regular channel. */
+ gnat_argv = (const char **) xmalloc (sizeof (char *));
+ gnat_argv[0] = xstrdup (save_argv[0]);
gnat_argc = 1;
}
-/* Ada code requires variables for these settings rather than elements
- of the global_options structure. */
-#undef optimize
-#undef optimize_size
-#undef flag_compare_debug
-#undef flag_short_enums
-#undef flag_stack_check
-int gnat_encodings = 0;
-int optimize;
-int optimize_size;
-int flag_compare_debug;
-int flag_short_enums;
-enum stack_check_type flag_stack_check = NO_STACK_CHECK;
-
/* Settings adjustments after switches processing by the back-end.
Note that the front-end switches processing (Scan_Compiler_Arguments)
has not been done yet at this point! */
if (!global_options_set.x_flag_diagnostics_show_caret)
global_dc->show_caret = false;
+ /* Set strict overflow by default for Ada. */
+ if (!global_options_set.x_flag_strict_overflow)
+ global_options.x_flag_strict_overflow = true;
+
/* Warn only if STABS is not the default: we don't want to emit a warning if
the user did not use a -gstabs option. */
if (PREFERRED_DEBUGGING_TYPE != DBX_DEBUG && write_symbols == DBX_DEBUG)
/* Here is the function to handle the compiler error processing in GCC. */
static void
-internal_error_function (diagnostic_context *context,
- const char *msgid, va_list *ap)
+internal_error_function (diagnostic_context *context, const char *msgid,
+ va_list *ap)
{
text_info tinfo;
char *buffer, *p, *loc;