From: vax@ccwf.cc.utexas.edu (Vax)
Newsgroups: comp.os.coherent
Subject: HELP WANTED: gnu make port
Summary: Probs with cc
Keywords: main make cc drugs guns cocaine psychoactive virtual reality
Date: 30 Aug 92 21:10:00 GMT
Organization: The University of Texas at Austin, Austin TX

While compiling gnu's make under Coh 4.0, I have some problems.  It seems
the C compiler cannot initialize arrays of structures!  Can someone tell me
a workaround?
These are the errors I get:
cc -DUSG -DUSGr3  -c main.c
216: main.c: cannot initialize fields
216: main.c: cannot initialize fields
216: main.c: cannot initialize fields
217: main.c: cannot initialize fields
217: main.c: cannot initialize fields
217: main.c: cannot initialize fields
[lines deleted, 3 errors per source code line number]
242: main.c: cannot initialize fields
242: main.c: cannot initialize fields
341: main.c: identifier "_IOLBF" is not defined

And this is the relevant code.
struct command_switch
  {
    char c;		/* The switch character.  */
    enum		/* Type of the value.  */
      {
	flag,		/* Turn int flag on.  */
	flag_off,	/* Turn int flag off.  */
	string,		/* One string per switch, may be in the same word.  */
	positive_int,	/* A positive integer.  */
	floating,	/* A floating-point number (double).  */
	ignore		/* Ignored.  */
      } type;

    char *value_ptr;	/* Pointer to the value-holding variable.  */

    unsigned int env:1;		/* Can come from MAKEFLAGS.  */
    unsigned int toenv:1;	/* Should be put in MAKEFLAGS.  */
    unsigned int no_makefile:1;	/* Don't propagate when remaking makefiles.  */

    char *noarg_value;	/* Pointer to value used if no argument is given.  */
    char *default_value;/* Pointer to default value.  */
  };


/* The table of command switches.  */

static struct command_switch switches[] =
  {
    { 'b', ignore, 0, 0, 0, 0, 0, 0 },
    { 'C', string, (char *) &directories, 0, 0, 0, 0, 0 },
    { 'd', flag, (char *) &debug_flag, 1, 1, 0, 0, 0 },
    { 'e', flag, (char *) &env_overrides, 1, 1, 0, 0, 0 },
    { 'f', string, (char *) &makefiles, 0, 0, 0, 0, 0 },
    { 'i', flag, (char *) &ignore_errors_flag, 1, 1, 0, 0, 0 },
    { 'I', string, (char *) &include_directories, 0, 0, 0, 0, 0 },
    { 'j', positive_int, (char *) &job_slots, 1, 1, 0,
	(char *) &inf_jobs, (char *) &default_job_slots },
    { 'k', flag, (char *) &keep_going_flag, 1, 1, 0,
	0, (char *) &default_keep_going_flag },
    { 'l', floating, (char *) &max_load_average, 1, 1, 0,
	(char *) &default_load_average, (char *) &default_load_average },
    { 'm', ignore, 0, 0, 0, 0, 0, 0 },
    { 'n', flag, (char *) &just_print_flag, 1, 1, 1, 0, 0 },
    { 'o', string, (char *) &old_files, 0, 0, 0, 0, 0 },
    { 'p', flag, (char *) &print_data_base_flag, 1, 1, 0, 0, 0 },
    { 'q', flag, (char *) &question_flag, 1, 1, 1, 0, 0 },
    { 'r', flag, (char *) &no_builtin_rules_flag, 1, 1, 0, 0, 0 },
    { 's', flag, (char *) &silent_flag, 1, 1, 0, 0, 0 },
    { 'S', flag_off, (char *) &keep_going_flag, 1, 1, 0,
	0, (char *) &default_keep_going_flag },
    { 't', flag, (char *) &touch_flag, 1, 1, 1, 0, 0 },
    { 'v', flag, (char *) &print_version_flag, 0, 0, 0, 0, 0 },
    { 'w', flag, (char *) &print_directory_flag, 1, 1, 0, 0, 0 },
    { 'W', string, (char *) &new_files, 0, 0, 0, 0, 0 },
    { '\0', ignore, 0, 0, 0, 0, 0 }
  };

-- 
EOM
Protect our endangered bandwidth - reply by email.
VAX#N8 vax@ccwf.utexas.edu