7 /* we keep all the warning symbols in a list, if we ever get a
8 warning, we'll search it the hard way. This won't be to bad since
9 warnings are infrequent, and never that many (true or false ?).
13 typedef struct warning_list_struct
{
14 struct warning_list_struct
*next
;
19 static warning_list_type
*warning_list
;
23 /* This is a warning symbol, add the error text to a list we keep, and mark
24 the symbol referenced as requiring a warning */
28 DEFUN(add_warning
,(sym
),
31 CONST
char *name
= ((asymbol
*)(sym
->value
))->name
;
32 warning_list_type
*new;
34 ldsym_type
*lookup
= ldsym_get(name
);
36 lookup
->flags
|= SYM_WARNING
;
38 new = (warning_list_type
*)ldmalloc(sizeof(warning_list_type
));
39 new->next
= warning_list
;
44 /* run through the list we kept, and find the warning associated with
47 DEFUN(fetch_warning
,(sym
),
50 warning_list_type
*ptr
= warning_list
;
51 while (ptr
!= (warning_list_type
*)NULL
) {
52 if (strcmp(((asymbol
*)(ptr
->sym
->value
))->name
, sym
->name
) == 0) {
53 return ptr
->sym
->name
;
57 return "This is a warning without a message !";
62 DEFUN(produce_warnings
,(lgs
,it
),
67 ptr
= lgs
->srefs_chain
;
68 while (ptr
!= (asymbol
**)NULL
) {
70 info("%B: %s\n", ref
->the_bfd
, fetch_warning(it
));
71 ptr
= (asymbol
**)(ref
->udata
);
This page took 0.031079 seconds and 5 git commands to generate.