6 /* we keep all the warning symbols in a list, if we ever get a
7 warning, we'll search it the hard way. This won't be to bad since
8 warnings are infrequent, and never that many (true or false ?).
12 typedef struct warning_list_struct
{
13 struct warning_list_struct
*next
;
18 static warning_list_type
*warning_list
;
22 /* This is a warning symbol, add the error text to a list we keep, and mark
23 the symbol referenced as requiring a warning */
27 DEFUN(add_warning
,(sym
),
30 CONST
char *name
= ((asymbol
*)(sym
->value
))->name
;
31 warning_list_type
*new;
33 ldsym_type
*lookup
= ldsym_get(name
);
35 lookup
->flags
|= SYM_WARNING
;
37 new = (warning_list_type
*)ldmalloc(sizeof(warning_list_type
));
38 new->next
= warning_list
;
43 /* run through the list we kept, and find the warning associated with
46 DEFUN(fetch_warning
,(sym
),
49 warning_list_type
*ptr
= warning_list
;
50 while (ptr
!= (warning_list_type
*)NULL
) {
51 if (strcmp(((asymbol
*)(ptr
->sym
->value
))->name
, sym
->name
) == 0) {
52 return ptr
->sym
->name
;
56 return "This is a warning without a message !";
61 DEFUN(produce_warnings
,(lgs
,it
),
66 ptr
= lgs
->srefs_chain
;
67 while (ptr
!= (asymbol
**)NULL
) {
69 info("%B: %s\n", ref
->the_bfd
, fetch_warning(it
));
70 ptr
= (asymbol
**)(ref
->udata
);
This page took 0.031105 seconds and 5 git commands to generate.