A patch to constify gcc.c

Jeffrey A Law law@hurl.cygnus.com
Wed Mar 10 02:45:00 GMT 1999


  In message <199902232151.QAA26710@caip.rutgers.edu>you write:
  > 	Okay, I redid this patch incorporating all of your changes above
  > plus updates made necessary by the last gcc2 merge. 
  > 
  > 	Regarding the casts, I simply avoided the changes which made
  > casting away const-ness necessary.  I'll address those sometime in the
  > future but its not important for now.  (I'm simply trying to get a
  > bootstrap using -Wwrite-strings into a managable shape.)  At the point
  > where we want to add -Wwrite-strings to WARN_CFLAGS, I can bring it up
  > again. 
  > 
  > 	Anyway, is this one okay to install?
  > 
  > 		--Kaveh
  > 
  > 
  > 
  > Tue Feb 23 15:46:17 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
  > 
  > 	* gcc.c (print_file_name, print_prog_name, spec_machine,
  >  	read_specs, set_spec, lookup_compiler, build_search_list,
  >  	putenv_from_prefixes, find_a_file, record_temp_file,
  >  	delete_if_ordinary, handle_braces, do_spec, do_spec_1, find_file,
  >  	is_directory, validate_switches, used_arg, default_arg,
  >  	pfatal_with_name, perror_with_name, pfatal_pexecute, fatal, error,
  >  	notice, add_preprocessor_option, add_assembler_option,
  >  	add_linker_option, process_command, execute,
  >  	unused_prefix_warnings, clear_args, fatal_error, user_specs,
  > 	compiler, link_command_spec, option_map, translate_options, 
  > 	make_temp_file, temp_name, programname, path_prefix,
  > 	machine_suffix, just_machine_suffix, gcc_exec_prefix,
  > 	standard_exec_prefix, standard_exec_prefix_1, md_exec_prefix,
  > 	md_startfile_prefix, md_startfile_prefix_1,
  > 	standard_startfile_prefix, standard_startfile_prefix_1,
  > 	standard_startfile_prefix_2, tooldir_base_prefix, tooldir_prefix,
  > 	multilib_dir, temp_filename, temp_file, command, switchstr,
  > 	infile, outfiles, input_filename, input_basename, input_suffix,
  > 	check_live_switch, main): Qualify a char* with the `const' keyword.
This is fine now.

On a more general note, I'd probably prefer to see what bugs we still need
to kill for -W -Wall before we proceed to add -Wwrite-strings.

Similarly, building a scheme which allows for clean prototyping of functions
in the backend files is probably more important than -Wwrite-strings too
since we could then start looking at missing prototype warnings (I've
seen far more bugs due to missing prototypes than write-strings problems
over the years in gcc).

Bernd's scheme for doing this held the most promise of the stuff I've seen
proposed over time.  It's not something I think we want to try and tackle
before egcs-1.2 though.


jeff


More information about the Gcc-patches mailing list