00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include "proj.h"
00036 #include "global.h"
00037 #include "info.h"
00038 #include "lex.h"
00039 #include "malloc.h"
00040 #include "name.h"
00041 #include "symbol.h"
00042 #include "top.h"
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 #if FFEGLOBAL_ENABLED
00062 static ffenameSpace ffeglobal_filewide_ = NULL;
00063 static const char *const ffeglobal_type_string_[] =
00064 {
00065 [FFEGLOBAL_typeNONE] "??",
00066 [FFEGLOBAL_typeMAIN] "main program",
00067 [FFEGLOBAL_typeEXT] "external",
00068 [FFEGLOBAL_typeSUBR] "subroutine",
00069 [FFEGLOBAL_typeFUNC] "function",
00070 [FFEGLOBAL_typeBDATA] "block data",
00071 [FFEGLOBAL_typeCOMMON] "common block",
00072 [FFEGLOBAL_typeANY] "?any?"
00073 };
00074 #endif
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 #if FFEGLOBAL_ENABLED
00088 void
00089 ffeglobal_drive (ffeglobal (*fn) (ffeglobal))
00090 {
00091 if (ffeglobal_filewide_ != NULL)
00092 ffename_space_drive_global (ffeglobal_filewide_, fn);
00093 }
00094
00095 #endif
00096
00097
00098
00099
00100
00101
00102 #if FFEGLOBAL_ENABLED
00103 static ffeglobal
00104 ffeglobal_new_ (ffename n)
00105 {
00106 ffeglobal g;
00107
00108 assert (n != NULL);
00109
00110 g = (ffeglobal) malloc_new_ks (malloc_pool_image (), "FFEGLOBAL",
00111 sizeof (*g));
00112 g->n = n;
00113 #ifdef FFECOM_globalHOOK
00114 g->hook = FFECOM_globalNULL;
00115 #endif
00116 g->tick = 0;
00117
00118 ffename_set_global (n, g);
00119
00120 return g;
00121 }
00122
00123 #endif
00124
00125
00126
00127
00128 void
00129 ffeglobal_init_1 ()
00130 {
00131 #if FFEGLOBAL_ENABLED
00132 if (ffeglobal_filewide_ != NULL)
00133 ffename_space_kill (ffeglobal_filewide_);
00134 ffeglobal_filewide_ = ffename_space_new (malloc_pool_image ());
00135 #endif
00136 }
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149 void
00150 ffeglobal_init_common (ffesymbol s, ffelexToken t)
00151 {
00152 #if FFEGLOBAL_ENABLED
00153 ffeglobal g;
00154
00155 g = ffesymbol_global (s);
00156
00157 if ((g == NULL) || (g->type != FFEGLOBAL_typeCOMMON))
00158 return;
00159 if (g->type == FFEGLOBAL_typeANY)
00160 return;
00161
00162 if (g->tick == ffe_count_2)
00163 return;
00164
00165 if (g->tick != 0)
00166 {
00167 if (g->u.common.initt != NULL)
00168 {
00169 ffebad_start (FFEBAD_COMMON_ALREADY_INIT);
00170 ffebad_string (ffesymbol_text (s));
00171 ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
00172 ffebad_here (1, ffelex_token_where_line (g->u.common.initt),
00173 ffelex_token_where_column (g->u.common.initt));
00174 ffebad_finish ();
00175 }
00176
00177
00178
00179 }
00180 else
00181 {
00182 if (g->u.common.blank)
00183 {
00184
00185 ffebad_start (FFEBAD_COMMON_BLANK_INIT);
00186 ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
00187 ffebad_finish ();
00188 }
00189
00190 g->u.common.initt = ffelex_token_use (t);
00191 }
00192
00193 g->tick = ffe_count_2;
00194 #endif
00195 }
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208 void
00209 ffeglobal_new_common (ffesymbol s, ffelexToken t, bool blank)
00210 {
00211 #if FFEGLOBAL_ENABLED
00212 ffename n;
00213 ffeglobal g;
00214
00215 if (ffesymbol_global (s) == NULL)
00216 {
00217 n = ffename_find (ffeglobal_filewide_, t);
00218 g = ffename_global (n);
00219 }
00220 else
00221 {
00222 g = ffesymbol_global (s);
00223 n = NULL;
00224 }
00225
00226 if ((g != NULL) && (g->type == FFEGLOBAL_typeANY))
00227 return;
00228
00229 if ((g != NULL) && (g->type != FFEGLOBAL_typeNONE))
00230 {
00231 if (g->type == FFEGLOBAL_typeCOMMON)
00232 {
00233
00234 assert (g->u.common.blank == blank);
00235 }
00236 else
00237 {
00238
00239
00240 if (ffe_is_globals () || ffe_is_warn_globals ())
00241 {
00242 ffebad_start (ffe_is_globals ()
00243 ? FFEBAD_FILEWIDE_ALREADY_SEEN
00244 : FFEBAD_FILEWIDE_ALREADY_SEEN_W);
00245 ffebad_string (ffelex_token_text (t));
00246 ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
00247 ffebad_here (1, ffelex_token_where_line (g->t),
00248 ffelex_token_where_column (g->t));
00249 ffebad_finish ();
00250 }
00251 g->type = FFEGLOBAL_typeANY;
00252 }
00253 }
00254 else
00255 {
00256 if (g == NULL)
00257 {
00258 g = ffeglobal_new_ (n);
00259 g->intrinsic = FALSE;
00260 }
00261 else if (g->intrinsic
00262 && !g->explicit_intrinsic
00263 && ffe_is_warn_globals ())
00264 {
00265
00266
00267
00268
00269 ffebad_start (FFEBAD_INTRINSIC_GLOBAL);
00270 ffebad_string (ffelex_token_text (t));
00271 ffebad_string ("common block");
00272 ffebad_string ("intrinsic");
00273 ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
00274 ffebad_here (1, ffelex_token_where_line (g->t),
00275 ffelex_token_where_column (g->t));
00276 ffebad_finish ();
00277 }
00278 g->t = ffelex_token_use (t);
00279 g->type = FFEGLOBAL_typeCOMMON;
00280 g->u.common.have_pad = FALSE;
00281 g->u.common.have_save = FALSE;
00282 g->u.common.have_size = FALSE;
00283 g->u.common.blank = blank;
00284 }
00285
00286 ffesymbol_set_global (s, g);
00287 #endif
00288 }
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300 void
00301 ffeglobal_new_progunit_ (ffesymbol s, ffelexToken t, ffeglobalType type)
00302 {
00303 #if FFEGLOBAL_ENABLED
00304 ffename n;
00305 ffeglobal g;
00306
00307 n = ffename_find (ffeglobal_filewide_, t);
00308 g = ffename_global (n);
00309 if ((g != NULL) && (g->type == FFEGLOBAL_typeANY))
00310 return;
00311
00312 if ((g != NULL)
00313 && ((g->type == FFEGLOBAL_typeMAIN)
00314 || (g->type == FFEGLOBAL_typeSUBR)
00315 || (g->type == FFEGLOBAL_typeFUNC)
00316 || (g->type == FFEGLOBAL_typeBDATA))
00317 && g->u.proc.defined)
00318 {
00319
00320 if (ffe_is_globals () || ffe_is_warn_globals ())
00321 {
00322 ffebad_start (ffe_is_globals ()
00323 ? FFEBAD_FILEWIDE_ALREADY_SEEN
00324 : FFEBAD_FILEWIDE_ALREADY_SEEN_W);
00325 ffebad_string (ffelex_token_text (t));
00326 ffebad_here (0, ffelex_token_where_line (t),
00327 ffelex_token_where_column (t));
00328 ffebad_here (1, ffelex_token_where_line (g->t),
00329 ffelex_token_where_column (g->t));
00330 ffebad_finish ();
00331 }
00332 g->type = FFEGLOBAL_typeANY;
00333 }
00334 else if ((g != NULL)
00335 && (g->type != FFEGLOBAL_typeNONE)
00336 && (g->type != FFEGLOBAL_typeEXT)
00337 && (g->type != type))
00338 {
00339
00340
00341
00342
00343
00344
00345
00346 if (ffe_is_globals () || ffe_is_warn_globals ())
00347 {
00348 ffebad_start (ffe_is_globals ()
00349 ? FFEBAD_FILEWIDE_DISAGREEMENT
00350 : FFEBAD_FILEWIDE_DISAGREEMENT_W);
00351 ffebad_string (ffelex_token_text (t));
00352 ffebad_string (ffeglobal_type_string_[type]);
00353 ffebad_string (ffeglobal_type_string_[g->type]);
00354 ffebad_here (0, ffelex_token_where_line (t),
00355 ffelex_token_where_column (t));
00356 ffebad_here (1, ffelex_token_where_line (g->t),
00357 ffelex_token_where_column (g->t));
00358 ffebad_finish ();
00359 }
00360 g->type = FFEGLOBAL_typeANY;
00361 }
00362 else
00363 {
00364 if (g == NULL)
00365 {
00366 g = ffeglobal_new_ (n);
00367 g->intrinsic = FALSE;
00368 g->u.proc.n_args = -1;
00369 g->u.proc.other_t = NULL;
00370 }
00371 else if ((ffesymbol_basictype (s) != FFEINFO_basictypeNONE)
00372 && (g->type == FFEGLOBAL_typeFUNC)
00373 && ((ffesymbol_basictype (s) != g->u.proc.bt)
00374 || (ffesymbol_kindtype (s) != g->u.proc.kt)
00375 || ((ffesymbol_size (s) != FFETARGET_charactersizeNONE)
00376 && (ffesymbol_size (s) != g->u.proc.sz))))
00377 {
00378
00379
00380
00381
00382 if (ffe_is_globals () || ffe_is_warn_globals ())
00383 {
00384 ffebad_start (ffe_is_globals ()
00385 ? FFEBAD_FILEWIDE_TYPE_MISMATCH
00386 : FFEBAD_FILEWIDE_TYPE_MISMATCH_W);
00387 ffebad_string (ffelex_token_text (t));
00388 ffebad_here (0, ffelex_token_where_line (t),
00389 ffelex_token_where_column (t));
00390 ffebad_here (1, ffelex_token_where_line (g->t),
00391 ffelex_token_where_column (g->t));
00392 ffebad_finish ();
00393 }
00394 g->type = FFEGLOBAL_typeANY;
00395 return;
00396 }
00397 if (g->intrinsic
00398 && !g->explicit_intrinsic
00399 && ffe_is_warn_globals ())
00400 {
00401
00402
00403
00404
00405 ffebad_start (FFEBAD_INTRINSIC_GLOBAL);
00406 ffebad_string (ffelex_token_text (t));
00407 ffebad_string ("global");
00408 ffebad_string ("intrinsic");
00409 ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
00410 ffebad_here (1, ffelex_token_where_line (g->t),
00411 ffelex_token_where_column (g->t));
00412 ffebad_finish ();
00413 }
00414 g->t = ffelex_token_use (t);
00415 if ((g->tick == 0)
00416 || (g->u.proc.bt == FFEINFO_basictypeNONE)
00417 || (g->u.proc.kt == FFEINFO_kindtypeNONE))
00418 {
00419 g->u.proc.bt = ffesymbol_basictype (s);
00420 g->u.proc.kt = ffesymbol_kindtype (s);
00421 g->u.proc.sz = ffesymbol_size (s);
00422 }
00423
00424
00425 if ((g->tick != 0)
00426 && (g->type != type))
00427 g->u.proc.n_args = -1;
00428 g->tick = ffe_count_2;
00429 g->type = type;
00430 g->u.proc.defined = TRUE;
00431 }
00432
00433 ffesymbol_set_global (s, g);
00434 #endif
00435 }
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448 void
00449 ffeglobal_pad_common (ffesymbol s, ffetargetAlign pad, ffewhereLine wl,
00450 ffewhereColumn wc)
00451 {
00452 #if FFEGLOBAL_ENABLED
00453 ffeglobal g;
00454
00455 g = ffesymbol_global (s);
00456 if ((g == NULL) || (g->type != FFEGLOBAL_typeCOMMON))
00457 return;
00458 if (g->type == FFEGLOBAL_typeANY)
00459 return;
00460
00461 if (!g->u.common.have_pad)
00462 {
00463 g->u.common.have_pad = TRUE;
00464 g->u.common.pad = pad;
00465 g->u.common.pad_where_line = ffewhere_line_use (wl);
00466 g->u.common.pad_where_col = ffewhere_column_use (wc);
00467
00468 if (pad != 0)
00469 {
00470 char padding[20];
00471
00472 sprintf (&padding[0], "%" ffetargetAlign_f "u", pad);
00473 ffebad_start (FFEBAD_COMMON_INIT_PAD);
00474 ffebad_string (ffesymbol_text (s));
00475 ffebad_string (padding);
00476 ffebad_string ((pad == 1)
00477 ? FFECOM_SIZE_UNIT : FFECOM_SIZE_UNITS);
00478 ffebad_here (0, wl, wc);
00479 ffebad_finish ();
00480 }
00481 }
00482 else
00483 {
00484 if (g->u.common.pad != pad)
00485 {
00486 char padding_1[20];
00487 char padding_2[20];
00488
00489 sprintf (&padding_1[0], "%" ffetargetAlign_f "u", pad);
00490 sprintf (&padding_2[0], "%" ffetargetAlign_f "u", g->u.common.pad);
00491 ffebad_start (FFEBAD_COMMON_DIFF_PAD);
00492 ffebad_string (ffesymbol_text (s));
00493 ffebad_string (padding_1);
00494 ffebad_here (0, wl, wc);
00495 ffebad_string (padding_2);
00496 ffebad_string ((pad == 1)
00497 ? FFECOM_SIZE_UNIT : FFECOM_SIZE_UNITS);
00498 ffebad_string ((g->u.common.pad == 1)
00499 ? FFECOM_SIZE_UNIT : FFECOM_SIZE_UNITS);
00500 ffebad_here (1, g->u.common.pad_where_line, g->u.common.pad_where_col);
00501 ffebad_finish ();
00502 }
00503
00504 if (g->u.common.pad < pad)
00505 {
00506 g->u.common.pad = pad;
00507 g->u.common.pad_where_line = ffewhere_line_use (wl);
00508 g->u.common.pad_where_col = ffewhere_column_use (wc);
00509 }
00510 }
00511 #endif
00512 }
00513
00514
00515
00516 void
00517 ffeglobal_proc_def_arg (ffesymbol s, int argno, const char *name, ffeglobalArgSummary as,
00518 ffeinfoBasictype bt, ffeinfoKindtype kt,
00519 bool array)
00520 {
00521 ffeglobal g = ffesymbol_global (s);
00522 ffeglobalArgInfo_ ai;
00523
00524 assert (g != NULL);
00525
00526 if (g->type == FFEGLOBAL_typeANY)
00527 return;
00528
00529 assert (g->u.proc.n_args >= 0);
00530
00531 if (argno >= g->u.proc.n_args)
00532 return;
00533
00534 ai = &g->u.proc.arg_info[argno];
00535
00536
00537
00538 if ((ai->t != NULL)
00539 && ffe_is_warn_globals ())
00540 {
00541 const char *refwhy = NULL;
00542 const char *defwhy = NULL;
00543 bool warn = FALSE;
00544
00545 switch (as)
00546 {
00547 case FFEGLOBAL_argsummaryREF:
00548 if ((ai->as != FFEGLOBAL_argsummaryREF)
00549 && (ai->as != FFEGLOBAL_argsummaryNONE)
00550 && ((ai->as != FFEGLOBAL_argsummaryDESCR)
00551 || (ai->bt != FFEINFO_basictypeCHARACTER)
00552 || (ai->bt == bt)))
00553 {
00554 warn = TRUE;
00555 refwhy = "passed by reference";
00556 }
00557 break;
00558
00559 case FFEGLOBAL_argsummaryDESCR:
00560 if ((ai->as != FFEGLOBAL_argsummaryDESCR)
00561 && (ai->as != FFEGLOBAL_argsummaryNONE)
00562 && ((ai->as != FFEGLOBAL_argsummaryREF)
00563 || (bt != FFEINFO_basictypeCHARACTER)
00564 || (ai->bt == bt)))
00565 {
00566 warn = TRUE;
00567 refwhy = "passed by descriptor";
00568 }
00569 break;
00570
00571 case FFEGLOBAL_argsummaryPROC:
00572 if ((ai->as != FFEGLOBAL_argsummaryPROC)
00573 && (ai->as != FFEGLOBAL_argsummarySUBR)
00574 && (ai->as != FFEGLOBAL_argsummaryFUNC)
00575 && (ai->as != FFEGLOBAL_argsummaryNONE))
00576 {
00577 warn = TRUE;
00578 refwhy = "a procedure";
00579 }
00580 break;
00581
00582 case FFEGLOBAL_argsummarySUBR:
00583 if ((ai->as != FFEGLOBAL_argsummaryPROC)
00584 && (ai->as != FFEGLOBAL_argsummarySUBR)
00585 && (ai->as != FFEGLOBAL_argsummaryNONE))
00586 {
00587 warn = TRUE;
00588 refwhy = "a subroutine";
00589 }
00590 break;
00591
00592 case FFEGLOBAL_argsummaryFUNC:
00593 if ((ai->as != FFEGLOBAL_argsummaryPROC)
00594 && (ai->as != FFEGLOBAL_argsummaryFUNC)
00595 && (ai->as != FFEGLOBAL_argsummaryNONE))
00596 {
00597 warn = TRUE;
00598 refwhy = "a function";
00599 }
00600 break;
00601
00602 case FFEGLOBAL_argsummaryALTRTN:
00603 if ((ai->as != FFEGLOBAL_argsummaryALTRTN)
00604 && (ai->as != FFEGLOBAL_argsummaryNONE))
00605 {
00606 warn = TRUE;
00607 refwhy = "an alternate-return label";
00608 }
00609 break;
00610
00611 default:
00612 break;
00613 }
00614
00615 if ((refwhy != NULL) && (defwhy == NULL))
00616 {
00617
00618
00619 switch (ai->as)
00620 {
00621 case FFEGLOBAL_argsummaryNONE:
00622 defwhy = "omitted";
00623 break;
00624
00625 case FFEGLOBAL_argsummaryVAL:
00626 defwhy = "passed by value";
00627 break;
00628
00629 case FFEGLOBAL_argsummaryREF:
00630 defwhy = "passed by reference";
00631 break;
00632
00633 case FFEGLOBAL_argsummaryDESCR:
00634 defwhy = "passed by descriptor";
00635 break;
00636
00637 case FFEGLOBAL_argsummaryPROC:
00638 defwhy = "a procedure";
00639 break;
00640
00641 case FFEGLOBAL_argsummarySUBR:
00642 defwhy = "a subroutine";
00643 break;
00644
00645 case FFEGLOBAL_argsummaryFUNC:
00646 defwhy = "a function";
00647 break;
00648
00649 case FFEGLOBAL_argsummaryALTRTN:
00650 defwhy = "an alternate-return label";
00651 break;
00652
00653 #if 0
00654 case FFEGLOBAL_argsummaryPTR:
00655 defwhy = "a pointer";
00656 break;
00657 #endif
00658
00659 default:
00660 defwhy = "???";
00661 break;
00662 }
00663 }
00664
00665 if (!warn
00666 && (bt != FFEINFO_basictypeHOLLERITH)
00667 && (bt != FFEINFO_basictypeTYPELESS)
00668 && (bt != FFEINFO_basictypeNONE)
00669 && (ai->bt != FFEINFO_basictypeHOLLERITH)
00670 && (ai->bt != FFEINFO_basictypeTYPELESS)
00671 && (ai->bt != FFEINFO_basictypeNONE))
00672 {
00673
00674
00675 if ((bt != ai->bt)
00676 && ((bt != FFEINFO_basictypeREAL)
00677 || (ai->bt != FFEINFO_basictypeCOMPLEX))
00678 && ((bt != FFEINFO_basictypeCOMPLEX)
00679 || (ai->bt != FFEINFO_basictypeREAL)))
00680 {
00681 warn = TRUE;
00682 refwhy = "one type";
00683 defwhy = "some other type";
00684 }
00685
00686 if (!warn && (kt != ai->kt))
00687 {
00688 warn = TRUE;
00689 refwhy = "one precision";
00690 defwhy = "some other precision";
00691 }
00692 }
00693
00694 if (warn)
00695 {
00696 char num[60];
00697
00698 if (name == NULL)
00699 sprintf (&num[0], "%d", argno + 1);
00700 else
00701 {
00702 if (strlen (name) < 30)
00703 sprintf (&num[0], "%d (named `%s')", argno + 1, name);
00704 else
00705 sprintf (&num[0], "%d (named `%.*s...')", argno + 1, 30, name);
00706 }
00707 ffebad_start (FFEBAD_FILEWIDE_ARG_W);
00708 ffebad_string (ffesymbol_text (s));
00709 ffebad_string (num);
00710 ffebad_string (refwhy);
00711 ffebad_string (defwhy);
00712 ffebad_here (0, ffelex_token_where_line (g->t), ffelex_token_where_column (g->t));
00713 ffebad_here (1, ffelex_token_where_line (ai->t), ffelex_token_where_column (ai->t));
00714 ffebad_finish ();
00715 }
00716 }
00717
00718
00719
00720 if (ai->t != NULL)
00721 ffelex_token_kill (ai->t);
00722 if ((as != FFEGLOBAL_argsummaryPROC)
00723 || (ai->t == NULL))
00724 ai->as = as;
00725 ai->t = ffelex_token_use (g->t);
00726 if (name == NULL)
00727 ai->name = NULL;
00728 else
00729 {
00730 ai->name = malloc_new_ks (malloc_pool_image (),
00731 "ffeglobalArgInfo_ name",
00732 strlen (name) + 1);
00733 strcpy (ai->name, name);
00734 }
00735 ai->bt = bt;
00736 ai->kt = kt;
00737 ai->array = array;
00738 }
00739
00740
00741
00742 void
00743 ffeglobal_proc_def_nargs (ffesymbol s, int n_args)
00744 {
00745 ffeglobal g = ffesymbol_global (s);
00746
00747 assert (g != NULL);
00748
00749 if (g->type == FFEGLOBAL_typeANY)
00750 return;
00751
00752 if (g->u.proc.n_args >= 0)
00753 {
00754 if (g->u.proc.n_args == n_args)
00755 return;
00756
00757 if (ffe_is_warn_globals ())
00758 {
00759 ffebad_start (FFEBAD_FILEWIDE_NARGS_W);
00760 ffebad_string (ffesymbol_text (s));
00761 if (g->u.proc.n_args > n_args)
00762 ffebad_string ("few");
00763 else
00764 ffebad_string ("many");
00765 ffebad_here (0, ffelex_token_where_line (g->u.proc.other_t),
00766 ffelex_token_where_column (g->u.proc.other_t));
00767 ffebad_here (1, ffelex_token_where_line (g->t),
00768 ffelex_token_where_column (g->t));
00769 ffebad_finish ();
00770 }
00771 }
00772
00773
00774
00775
00776 g->u.proc.n_args = n_args;
00777 g->u.proc.other_t = NULL;
00778
00779 if (n_args == 0)
00780 {
00781 g->u.proc.arg_info = NULL;
00782 return;
00783 }
00784
00785 g->u.proc.arg_info
00786 = (ffeglobalArgInfo_) malloc_new_ks (malloc_pool_image (),
00787 "ffeglobalArgInfo_",
00788 n_args * sizeof (g->u.proc.arg_info[0]));
00789 while (n_args-- > 0)
00790 g->u.proc.arg_info[n_args].t = NULL;
00791 }
00792
00793
00794
00795 bool
00796 ffeglobal_proc_ref_arg (ffesymbol s, int argno, ffeglobalArgSummary as,
00797 ffeinfoBasictype bt, ffeinfoKindtype kt,
00798 bool array, ffelexToken t)
00799 {
00800 ffeglobal g = ffesymbol_global (s);
00801 ffeglobalArgInfo_ ai;
00802
00803 assert (g != NULL);
00804
00805 if (g->type == FFEGLOBAL_typeANY)
00806 return FALSE;
00807
00808 assert (g->u.proc.n_args >= 0);
00809
00810 if (argno >= g->u.proc.n_args)
00811 return TRUE;
00812
00813 ai = &g->u.proc.arg_info[argno];
00814
00815
00816
00817 if (ai->t != NULL)
00818 {
00819 const char *refwhy = NULL;
00820 const char *defwhy = NULL;
00821 bool fail = FALSE;
00822 bool warn = FALSE;
00823
00824 switch (as)
00825 {
00826 case FFEGLOBAL_argsummaryNONE:
00827 if (g->u.proc.defined)
00828 {
00829 fail = TRUE;
00830 refwhy = "omitted";
00831 defwhy = "not optional";
00832 }
00833 break;
00834
00835 case FFEGLOBAL_argsummaryVAL:
00836 if (ai->as != FFEGLOBAL_argsummaryVAL)
00837 {
00838 fail = TRUE;
00839 refwhy = "passed by value";
00840 }
00841 break;
00842
00843 case FFEGLOBAL_argsummaryREF:
00844 if ((ai->as != FFEGLOBAL_argsummaryREF)
00845 && (ai->as != FFEGLOBAL_argsummaryNONE)
00846 && ((ai->as != FFEGLOBAL_argsummaryDESCR)
00847 || (ai->bt != FFEINFO_basictypeCHARACTER)
00848 || (ai->bt == bt)))
00849 {
00850 fail = TRUE;
00851 refwhy = "passed by reference";
00852 }
00853 break;
00854
00855 case FFEGLOBAL_argsummaryDESCR:
00856 if ((ai->as != FFEGLOBAL_argsummaryDESCR)
00857 && (ai->as != FFEGLOBAL_argsummaryNONE)
00858 && ((ai->as != FFEGLOBAL_argsummaryREF)
00859 || (bt != FFEINFO_basictypeCHARACTER)
00860 || (ai->bt == bt)))
00861 {
00862 fail = TRUE;
00863 refwhy = "passed by descriptor";
00864 }
00865 break;
00866
00867 case FFEGLOBAL_argsummaryPROC:
00868 if ((ai->as != FFEGLOBAL_argsummaryPROC)
00869 && (ai->as != FFEGLOBAL_argsummarySUBR)
00870 && (ai->as != FFEGLOBAL_argsummaryFUNC)
00871 && (ai->as != FFEGLOBAL_argsummaryNONE))
00872 {
00873 fail = TRUE;
00874 refwhy = "a procedure";
00875 }
00876 break;
00877
00878 case FFEGLOBAL_argsummarySUBR:
00879 if ((ai->as != FFEGLOBAL_argsummaryPROC)
00880 && (ai->as != FFEGLOBAL_argsummarySUBR)
00881 && (ai->as != FFEGLOBAL_argsummaryNONE))
00882 {
00883 fail = TRUE;
00884 refwhy = "a subroutine";
00885 }
00886 break;
00887
00888 case FFEGLOBAL_argsummaryFUNC:
00889 if ((ai->as != FFEGLOBAL_argsummaryPROC)
00890 && (ai->as != FFEGLOBAL_argsummaryFUNC)
00891 && (ai->as != FFEGLOBAL_argsummaryNONE))
00892 {
00893 fail = TRUE;
00894 refwhy = "a function";
00895 }
00896 break;
00897
00898 case FFEGLOBAL_argsummaryALTRTN:
00899 if ((ai->as != FFEGLOBAL_argsummaryALTRTN)
00900 && (ai->as != FFEGLOBAL_argsummaryNONE))
00901 {
00902 fail = TRUE;
00903 refwhy = "an alternate-return label";
00904 }
00905 break;
00906
00907 #if 0
00908 case FFEGLOBAL_argsummaryPTR:
00909 if ((ai->as != FFEGLOBAL_argsummaryPTR)
00910 && (ai->as != FFEGLOBAL_argsummaryNONE))
00911 {
00912 fail = TRUE;
00913 refwhy = "a pointer";
00914 }
00915 break;
00916 #endif
00917
00918 default:
00919 break;
00920 }
00921
00922 if ((refwhy != NULL) && (defwhy == NULL))
00923 {
00924
00925
00926 switch (ai->as)
00927 {
00928 case FFEGLOBAL_argsummaryNONE:
00929 defwhy = "omitted";
00930 break;
00931
00932 case FFEGLOBAL_argsummaryVAL:
00933 defwhy = "passed by value";
00934 break;
00935
00936 case FFEGLOBAL_argsummaryREF:
00937 defwhy = "passed by reference";
00938 break;
00939
00940 case FFEGLOBAL_argsummaryDESCR:
00941 defwhy = "passed by descriptor";
00942 break;
00943
00944 case FFEGLOBAL_argsummaryPROC:
00945 defwhy = "a procedure";
00946 break;
00947
00948 case FFEGLOBAL_argsummarySUBR:
00949 defwhy = "a subroutine";
00950 break;
00951
00952 case FFEGLOBAL_argsummaryFUNC:
00953 defwhy = "a function";
00954 break;
00955
00956 case FFEGLOBAL_argsummaryALTRTN:
00957 defwhy = "an alternate-return label";
00958 break;
00959
00960 #if 0
00961 case FFEGLOBAL_argsummaryPTR:
00962 defwhy = "a pointer";
00963 break;
00964 #endif
00965
00966 default:
00967 defwhy = "???";
00968 break;
00969 }
00970 }
00971
00972 if (!fail && !warn
00973 && (bt != FFEINFO_basictypeHOLLERITH)
00974 && (bt != FFEINFO_basictypeTYPELESS)
00975 && (bt != FFEINFO_basictypeNONE)
00976 && (ai->bt != FFEINFO_basictypeHOLLERITH)
00977 && (ai->bt != FFEINFO_basictypeNONE)
00978 && (ai->bt != FFEINFO_basictypeTYPELESS))
00979 {
00980
00981
00982 if ((bt != ai->bt)
00983 && ((bt != FFEINFO_basictypeREAL)
00984 || (ai->bt != FFEINFO_basictypeCOMPLEX))
00985 && ((bt != FFEINFO_basictypeCOMPLEX)
00986 || (ai->bt != FFEINFO_basictypeREAL)))
00987 {
00988 if (((bt == FFEINFO_basictypeINTEGER)
00989 && (ai->bt == FFEINFO_basictypeLOGICAL))
00990 || ((bt == FFEINFO_basictypeLOGICAL)
00991 && (ai->bt == FFEINFO_basictypeINTEGER)))
00992 warn = TRUE;
00993 else
00994 fail = TRUE;
00995 refwhy = "one type";
00996 defwhy = "some other type";
00997 }
00998
00999 if (!fail && !warn && (kt != ai->kt))
01000 {
01001 fail = TRUE;
01002 refwhy = "one precision";
01003 defwhy = "some other precision";
01004 }
01005 }
01006
01007 if (fail && ! g->u.proc.defined)
01008 {
01009
01010 fail = FALSE;
01011 warn = TRUE;
01012 }
01013
01014 if (fail && ! ffe_is_globals ())
01015 {
01016 warn = TRUE;
01017 fail = FALSE;
01018 }
01019
01020 if (fail || (warn && ffe_is_warn_globals ()))
01021 {
01022 char num[60];
01023
01024 if (ai->name == NULL)
01025 sprintf (&num[0], "%d", argno + 1);
01026 else
01027 {
01028 if (strlen (ai->name) < 30)
01029 sprintf (&num[0], "%d (named `%s')", argno + 1, ai->name);
01030 else
01031 sprintf (&num[0], "%d (named `%.*s...')", argno + 1, 30, ai->name);
01032 }
01033 ffebad_start (fail ? FFEBAD_FILEWIDE_ARG : FFEBAD_FILEWIDE_ARG_W);
01034 ffebad_string (ffesymbol_text (s));
01035 ffebad_string (num);
01036 ffebad_string (refwhy);
01037 ffebad_string (defwhy);
01038 ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
01039 ffebad_here (1, ffelex_token_where_line (ai->t), ffelex_token_where_column (ai->t));
01040 ffebad_finish ();
01041 return (fail ? FALSE : TRUE);
01042 }
01043
01044 if (warn)
01045 return TRUE;
01046 }
01047
01048
01049
01050 if (ai->t != NULL)
01051 ffelex_token_kill (ai->t);
01052 if ((as != FFEGLOBAL_argsummaryPROC)
01053 || (ai->t == NULL))
01054 ai->as = as;
01055 ai->t = ffelex_token_use (g->t);
01056 ai->name = NULL;
01057 ai->bt = bt;
01058 ai->kt = kt;
01059 ai->array = array;
01060 return TRUE;
01061 }
01062
01063 bool
01064 ffeglobal_proc_ref_nargs (ffesymbol s, int n_args, ffelexToken t)
01065 {
01066 ffeglobal g = ffesymbol_global (s);
01067
01068 assert (g != NULL);
01069
01070 if (g->type == FFEGLOBAL_typeANY)
01071 return FALSE;
01072
01073 if (g->u.proc.n_args >= 0)
01074 {
01075 if (g->u.proc.n_args == n_args)
01076 return TRUE;
01077
01078 if (g->u.proc.defined && ffe_is_globals ())
01079 {
01080 ffebad_start (FFEBAD_FILEWIDE_NARGS);
01081 ffebad_string (ffesymbol_text (s));
01082 if (g->u.proc.n_args > n_args)
01083 ffebad_string ("few");
01084 else
01085 ffebad_string ("many");
01086 ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
01087 ffebad_here (1, ffelex_token_where_line (g->t),
01088 ffelex_token_where_column (g->t));
01089 ffebad_finish ();
01090 return FALSE;
01091 }
01092
01093 if (ffe_is_warn_globals ())
01094 {
01095 ffebad_start (FFEBAD_FILEWIDE_NARGS_W);
01096 ffebad_string (ffesymbol_text (s));
01097 if (g->u.proc.n_args > n_args)
01098 ffebad_string ("few");
01099 else
01100 ffebad_string ("many");
01101 ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
01102 ffebad_here (1, ffelex_token_where_line (g->t),
01103 ffelex_token_where_column (g->t));
01104 ffebad_finish ();
01105 }
01106
01107 return TRUE;
01108 }
01109
01110
01111
01112
01113 g->u.proc.n_args = n_args;
01114 g->u.proc.other_t = ffelex_token_use (t);
01115
01116
01117
01118 if (g->t != NULL)
01119 ffelex_token_kill (g->t);
01120 g->t = ffelex_token_use (t);
01121
01122 if (n_args == 0)
01123 {
01124 g->u.proc.arg_info = NULL;
01125 return TRUE;
01126 }
01127
01128 g->u.proc.arg_info
01129 = (ffeglobalArgInfo_) malloc_new_ks (malloc_pool_image (),
01130 "ffeglobalArgInfo_",
01131 n_args * sizeof (g->u.proc.arg_info[0]));
01132 while (n_args-- > 0)
01133 g->u.proc.arg_info[n_args].t = NULL;
01134
01135 return TRUE;
01136 }
01137
01138
01139
01140
01141 ffeglobal
01142 ffeglobal_promoted (ffesymbol s)
01143 {
01144 #if FFEGLOBAL_ENABLED
01145 ffename n;
01146 ffeglobal g;
01147
01148 assert (ffesymbol_global (s) == NULL);
01149
01150 n = ffename_find (ffeglobal_filewide_, ffename_token (ffesymbol_name (s)));
01151 g = ffename_global (n);
01152
01153 return g;
01154 #else
01155 return NULL;
01156 #endif
01157 }
01158
01159
01160
01161
01162
01163 void
01164 ffeglobal_ref_intrinsic (ffesymbol s, ffelexToken t, bool explicit)
01165 {
01166 #if FFEGLOBAL_ENABLED
01167 ffename n;
01168 ffeglobal g;
01169
01170 if (ffesymbol_global (s) == NULL)
01171 {
01172 n = ffename_find (ffeglobal_filewide_, t);
01173 g = ffename_global (n);
01174 }
01175 else
01176 {
01177 g = ffesymbol_global (s);
01178 n = NULL;
01179 }
01180
01181 if ((g != NULL) && (g->type == FFEGLOBAL_typeANY))
01182 return;
01183
01184 if ((g != NULL) && (g->type != FFEGLOBAL_typeNONE))
01185 {
01186 if (! explicit
01187 && ! g->intrinsic
01188 && ffe_is_warn_globals ())
01189 {
01190
01191
01192
01193
01194 ffebad_start (FFEBAD_INTRINSIC_GLOBAL);
01195 ffebad_string (ffelex_token_text (t));
01196 ffebad_string ("intrinsic");
01197 ffebad_string ("global");
01198 ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
01199 ffebad_here (1, ffelex_token_where_line (g->t),
01200 ffelex_token_where_column (g->t));
01201 ffebad_finish ();
01202 }
01203 }
01204 else
01205 {
01206 if (g == NULL)
01207 {
01208 g = ffeglobal_new_ (n);
01209 g->tick = ffe_count_2;
01210 g->type = FFEGLOBAL_typeNONE;
01211 g->intrinsic = TRUE;
01212 g->explicit_intrinsic = explicit;
01213 g->t = ffelex_token_use (t);
01214 }
01215 else if (g->intrinsic
01216 && (explicit != g->explicit_intrinsic)
01217 && (g->tick != ffe_count_2)
01218 && ffe_is_warn_globals ())
01219 {
01220
01221
01222
01223
01224
01225 ffebad_start (FFEBAD_INTRINSIC_EXPIMP);
01226 ffebad_string (ffelex_token_text (t));
01227 ffebad_string (explicit ? "explicit" : "implicit");
01228 ffebad_string (explicit ? "implicit" : "explicit");
01229 ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
01230 ffebad_here (1, ffelex_token_where_line (g->t),
01231 ffelex_token_where_column (g->t));
01232 ffebad_finish ();
01233 }
01234 }
01235
01236 g->intrinsic = TRUE;
01237 if (explicit)
01238 g->explicit_intrinsic = TRUE;
01239
01240 ffesymbol_set_global (s, g);
01241 #endif
01242 }
01243
01244
01245
01246
01247 bool
01248 ffeglobal_ref_progunit_ (ffesymbol s, ffelexToken t, ffeglobalType type)
01249 {
01250 #if FFEGLOBAL_ENABLED
01251 ffename n = NULL;
01252 ffeglobal g;
01253
01254
01255
01256
01257 if (type == FFEGLOBAL_typeBDATA)
01258 type = FFEGLOBAL_typeEXT;
01259
01260 g = ffesymbol_global (s);
01261 if (g == NULL)
01262 {
01263 n = ffename_find (ffeglobal_filewide_, t);
01264 g = ffename_global (n);
01265 if (g != NULL)
01266 ffesymbol_set_global (s, g);
01267 }
01268
01269 if ((g != NULL) && (g->type == FFEGLOBAL_typeANY))
01270 return TRUE;
01271
01272 if ((g != NULL)
01273 && (g->type != FFEGLOBAL_typeNONE)
01274 && (g->type != FFEGLOBAL_typeEXT)
01275 && (g->type != type)
01276 && (type != FFEGLOBAL_typeEXT))
01277 {
01278
01279
01280
01281 if ((((type == FFEGLOBAL_typeBDATA)
01282 && (g->type != FFEGLOBAL_typeCOMMON))
01283 || ((g->type == FFEGLOBAL_typeBDATA)
01284 && (type != FFEGLOBAL_typeCOMMON)
01285 && ! g->u.proc.defined)))
01286 {
01287 #if 0
01288 if (ffe_is_warn_globals ())
01289 {
01290
01291 ffebad_start (FFEBAD_FILEWIDE_TIFF);
01292 ffebad_string (ffelex_token_text (t));
01293 ffebad_string (ffeglobal_type_string_[type]);
01294 ffebad_string (ffeglobal_type_string_[g->type]);
01295 ffebad_here (0, ffelex_token_where_line (t),
01296 ffelex_token_where_column (t));
01297 ffebad_here (1, ffelex_token_where_line (g->t),
01298 ffelex_token_where_column (g->t));
01299 ffebad_finish ();
01300 }
01301 #endif
01302 }
01303 else if (ffe_is_globals () || ffe_is_warn_globals ())
01304 {
01305 ffebad_start (ffe_is_globals ()
01306 ? FFEBAD_FILEWIDE_DISAGREEMENT
01307 : FFEBAD_FILEWIDE_DISAGREEMENT_W);
01308 ffebad_string (ffelex_token_text (t));
01309 ffebad_string (ffeglobal_type_string_[type]);
01310 ffebad_string (ffeglobal_type_string_[g->type]);
01311 ffebad_here (0, ffelex_token_where_line (t),
01312 ffelex_token_where_column (t));
01313 ffebad_here (1, ffelex_token_where_line (g->t),
01314 ffelex_token_where_column (g->t));
01315 ffebad_finish ();
01316 g->type = FFEGLOBAL_typeANY;
01317 return (! ffe_is_globals ());
01318 }
01319 }
01320
01321 if ((g != NULL)
01322 && (type == FFEGLOBAL_typeFUNC))
01323 {
01324
01325 if ((g->tick == ffe_count_2)
01326 && (ffesymbol_basictype (s) != FFEINFO_basictypeNONE)
01327 && (ffesymbol_kindtype (s) != FFEINFO_kindtypeNONE))
01328 {
01329 g->u.proc.bt = ffesymbol_basictype (s);
01330 g->u.proc.kt = ffesymbol_kindtype (s);
01331 g->u.proc.sz = ffesymbol_size (s);
01332 }
01333
01334 if (g->type == FFEGLOBAL_typeFUNC
01335 && g->u.proc.bt != FFEINFO_basictypeNONE
01336 && ffesymbol_basictype (s) != FFEINFO_basictypeNONE
01337 && (ffesymbol_basictype (s) != g->u.proc.bt
01338 || ffesymbol_kindtype (s) != g->u.proc.kt
01339
01340
01341
01342 || (g->u.proc.defined
01343 && ffesymbol_size (s) != g->u.proc.sz
01344 && ffesymbol_size (s) != FFETARGET_charactersizeNONE
01345 && g->u.proc.sz != FFETARGET_charactersizeNONE)))
01346 {
01347 int error;
01348
01349
01350
01351
01352
01353
01354
01355
01356
01357 error = (g->tick != ffe_count_2
01358 && g->u.proc.defined
01359 && ffe_is_globals ());
01360 if (error || ffe_is_warn_globals ())
01361 {
01362 ffebad_start (error
01363 ? FFEBAD_FILEWIDE_TYPE_MISMATCH
01364 : FFEBAD_FILEWIDE_TYPE_MISMATCH_W);
01365 ffebad_string (ffelex_token_text (t));
01366 if (g->tick == ffe_count_2)
01367 {
01368
01369
01370
01371
01372 ffebad_here (0, ffelex_token_where_line (g->t),
01373 ffelex_token_where_column (g->t));
01374 ffebad_here (1, ffelex_token_where_line (g->u.proc.other_t),
01375 ffelex_token_where_column (g->u.proc.other_t));
01376 }
01377 else
01378 {
01379
01380
01381
01382 ffebad_here (0, ffelex_token_where_line (t),
01383 ffelex_token_where_column (t));
01384 ffebad_here (1, ffelex_token_where_line (g->t),
01385 ffelex_token_where_column (g->t));
01386 }
01387 ffebad_finish ();
01388 if (error)
01389 g->type = FFEGLOBAL_typeANY;
01390 return FALSE;
01391 }
01392 }
01393 }
01394
01395 if (g == NULL)
01396 {
01397 g = ffeglobal_new_ (n);
01398 g->t = ffelex_token_use (t);
01399 g->tick = ffe_count_2;
01400 g->intrinsic = FALSE;
01401 g->type = type;
01402 g->u.proc.defined = FALSE;
01403 g->u.proc.bt = ffesymbol_basictype (s);
01404 g->u.proc.kt = ffesymbol_kindtype (s);
01405 g->u.proc.sz = ffesymbol_size (s);
01406 g->u.proc.n_args = -1;
01407 ffesymbol_set_global (s, g);
01408 }
01409 else if (g->intrinsic
01410 && !g->explicit_intrinsic
01411 && (g->tick != ffe_count_2)
01412 && ffe_is_warn_globals ())
01413 {
01414
01415
01416
01417 ffebad_start (FFEBAD_INTRINSIC_GLOBAL);
01418 ffebad_string (ffelex_token_text (t));
01419 ffebad_string ("global");
01420 ffebad_string ("intrinsic");
01421 ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
01422 ffebad_here (1, ffelex_token_where_line (g->t),
01423 ffelex_token_where_column (g->t));
01424 ffebad_finish ();
01425 }
01426
01427 if ((g->type != type)
01428 && (type != FFEGLOBAL_typeEXT))
01429 {
01430
01431 g->t = ffelex_token_use (t);
01432 g->type = type;
01433 #ifdef FFECOM_globalHOOK
01434 g->hook = FFECOM_globalNULL;
01435 #endif
01436 g->u.proc.n_args = -1;
01437 }
01438
01439 return TRUE;
01440 #endif
01441 }
01442
01443
01444
01445
01446
01447
01448
01449
01450
01451
01452
01453
01454 void
01455 ffeglobal_save_common (ffesymbol s, bool save, ffewhereLine wl,
01456 ffewhereColumn wc)
01457 {
01458 #if FFEGLOBAL_ENABLED
01459 ffeglobal g;
01460
01461 g = ffesymbol_global (s);
01462 if ((g == NULL) || (g->type != FFEGLOBAL_typeCOMMON))
01463 return;
01464 if (g->type == FFEGLOBAL_typeANY)
01465 return;
01466
01467 if (!g->u.common.have_save)
01468 {
01469 g->u.common.have_save = TRUE;
01470 g->u.common.save = save;
01471 g->u.common.save_where_line = ffewhere_line_use (wl);
01472 g->u.common.save_where_col = ffewhere_column_use (wc);
01473 }
01474 else
01475 {
01476 if ((g->u.common.save != save) && ffe_is_pedantic ())
01477 {
01478 ffebad_start (FFEBAD_COMMON_DIFF_SAVE);
01479 ffebad_string (ffesymbol_text (s));
01480 ffebad_here (save ? 0 : 1, wl, wc);
01481 ffebad_here (save ? 1 : 0, g->u.common.pad_where_line, g->u.common.pad_where_col);
01482 ffebad_finish ();
01483 }
01484 }
01485 #endif
01486 }
01487
01488
01489
01490
01491
01492
01493
01494
01495
01496
01497
01498
01499
01500 #if FFEGLOBAL_ENABLED
01501 bool
01502 ffeglobal_size_common (ffesymbol s, ffetargetOffset size)
01503 {
01504 ffeglobal g;
01505
01506 g = ffesymbol_global (s);
01507 if ((g == NULL) || (g->type != FFEGLOBAL_typeCOMMON))
01508 return FALSE;
01509 if (g->type == FFEGLOBAL_typeANY)
01510 return FALSE;
01511
01512 if (!g->u.common.have_size)
01513 {
01514 g->u.common.have_size = TRUE;
01515 g->u.common.size = size;
01516 return TRUE;
01517 }
01518
01519 if ((g->tick > 0) && (g->tick < ffe_count_2)
01520 && (g->u.common.size < size))
01521 {
01522 char oldsize[40];
01523 char newsize[40];
01524
01525
01526
01527
01528
01529 sprintf (&oldsize[0], "%" ffetargetOffset_f "d", g->u.common.size);
01530 sprintf (&newsize[0], "%" ffetargetOffset_f "d", size);
01531
01532 ffebad_start (FFEBAD_COMMON_ENLARGED);
01533 ffebad_string (ffesymbol_text (s));
01534 ffebad_string (oldsize);
01535 ffebad_string (newsize);
01536 ffebad_string ((g->u.common.size == 1)
01537 ? FFECOM_SIZE_UNIT : FFECOM_SIZE_UNITS);
01538 ffebad_string ((size == 1)
01539 ? FFECOM_SIZE_UNIT : FFECOM_SIZE_UNITS);
01540 ffebad_here (0, ffelex_token_where_line (g->u.common.initt),
01541 ffelex_token_where_column (g->u.common.initt));
01542 ffebad_here (1, ffesymbol_where_line (s),
01543 ffesymbol_where_column (s));
01544 ffebad_finish ();
01545 }
01546 else if ((g->u.common.size != size) && !g->u.common.blank)
01547 {
01548 char oldsize[40];
01549 char newsize[40];
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562 sprintf (&oldsize[0], "%" ffetargetOffset_f "d", g->u.common.size);
01563 sprintf (&newsize[0], "%" ffetargetOffset_f "d", size);
01564
01565 ffebad_start (FFEBAD_COMMON_DIFF_SIZE);
01566 ffebad_string (ffesymbol_text (s));
01567 ffebad_string (oldsize);
01568 ffebad_string (newsize);
01569 ffebad_string ((g->u.common.size == 1)
01570 ? FFECOM_SIZE_UNIT : FFECOM_SIZE_UNITS);
01571 ffebad_string ((size == 1)
01572 ? FFECOM_SIZE_UNIT : FFECOM_SIZE_UNITS);
01573 ffebad_here (0, ffelex_token_where_line (g->t),
01574 ffelex_token_where_column (g->t));
01575 ffebad_here (1, ffesymbol_where_line (s),
01576 ffesymbol_where_column (s));
01577 ffebad_finish ();
01578 }
01579
01580 if (size > g->u.common.size)
01581 {
01582 g->u.common.size = size;
01583 return TRUE;
01584 }
01585
01586 return FALSE;
01587 }
01588
01589 #endif
01590 void
01591 ffeglobal_terminate_1 ()
01592 {
01593 }