Skip to content

Commit 894d096

Browse files
committed
未使用変数の警告に対応
* [-Wunused-but-set-variable]による警告の個所に対してマクロ"COB_UNUSED"を適用
1 parent 7e52ba8 commit 894d096

File tree

10 files changed

+13
-0
lines changed

10 files changed

+13
-0
lines changed

cobc/codegen.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,7 @@ output_param (cb_tree x, int id)
998998
int extrefs;
999999
int sav_stack_id;
10001000
char fname[12];
1001+
COB_UNUSED(extrefs);
10011002

10021003
param_id = id;
10031004

cobc/pplex.l

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ check_dollar_directive (char *buff, int *line_size)
743743
char sbuff[5][256];
744744
int isDEFINED, isNOT;
745745
int i;
746+
COB_UNUSED(n);
746747

747748
if (cb_source_format == CB_FORMAT_FIXED) {
748749
if (*line_size < 8) {

cobc/pplex.l.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ check_dollar_directive (char *buff, int *line_size)
758758
char sbuff[5][256];
759759
int isDEFINED, isNOT;
760760
int i;
761+
COB_UNUSED(n);
761762

762763
if (cb_source_format == CB_FORMAT_FIXED) {
763764
if (*line_size < 8) {

cobc/tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,7 @@ cb_build_picture (const char *str)
12751275
unsigned char lastonechar = 0;
12761276
unsigned char lasttwochar = 0;
12771277
unsigned char buff[COB_SMALL_BUFF];
1278+
COB_UNUSED(flg);
12781279

12791280
pic = make_tree (CB_TAG_PICTURE, CB_CATEGORY_UNKNOWN, sizeof (struct cb_picture));
12801281
if (strlen (str) > 50) {

cobc/typeck.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@ cb_reference_type_check (cb_tree ref, cb_tree x, const char *name, int size, int
832832
char strbuf[256];
833833
int offset = 0 ;
834834
int ret = 0;
835+
COB_UNUSED(r);
835836

836837
r = CB_REFERENCE (ref);
837838
switch (CB_TREE_TAG (x)) {

libcob/call.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ void *
714714
cobsavenv2 (struct cobjmp_buf *jbuf, const int jsize)
715715
{
716716
int jtemp;
717+
COB_UNUSED(jtemp);
717718

718719
/* Shut up compiler */
719720
jtemp = jsize;

libcob/common.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,6 +2095,9 @@ cobcommandline (int flags, int *pargc, char ***pargv, char ***penvp, char **pnam
20952095
char **spenvp;
20962096
char *spname;
20972097
int sflags;
2098+
COB_UNUSED(spenvp);
2099+
COB_UNUSED(spname);
2100+
COB_UNUSED(sflags);
20982101

20992102
if (!cob_initialized) {
21002103
cob_runtime_error ("'cobcommandline' - Runtime has not been initialized");

libcob/move.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ cob_move_fp_to_display (cob_field *f1, cob_field *f2)
554554
char *x, *y;
555555
char buff[64];
556556
char buff2[64];
557+
COB_UNUSED(frac);
557558

558559
memset ((ucharptr)buff, 0, sizeof (buff));
559560
memset ((ucharptr)buff2, 0, sizeof (buff2));

libcob/screenio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,8 @@ CBL_OC_KEISEN (unsigned char * cmd, unsigned char * line, unsigned char * col, u
16111611
int k_lng2;
16121612
int k_color;
16131613
int k_prn;
1614+
COB_UNUSED(k_color);
1615+
COB_UNUSED(k_prn);
16141616

16151617
COB_CHK_PARMS (CBL_OC_ATTRIBUTE, 5);
16161618

libcob/strings.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ cob_inspect_before (const cob_field *str)
268268
unsigned char *p2;
269269
unsigned int n;
270270
int fig;
271+
COB_UNUSED(sign);
271272

272273
switch (COB_FIELD_TYPE (str)) {
273274
case COB_TYPE_NUMERIC_DISPLAY:

0 commit comments

Comments
 (0)