Skip to content

Comments

netutils/netcat: fixed ISO C89/C90 related warnings#972

Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom
a-lunev:fix_netcat_c89_warnings
Jan 21, 2022
Merged

netutils/netcat: fixed ISO C89/C90 related warnings#972
xiaoxiang781216 merged 1 commit intoapache:masterfrom
a-lunev:fix_netcat_c89_warnings

Conversation

@a-lunev
Copy link
Contributor

@a-lunev a-lunev commented Jan 20, 2022

Summary

Fixed the following types of warnings:
warning: ISO C90 forbids variable length array ‘buf’ [-Wvla]
warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

Impact

netutils/netcat

Testing

warning: ISO C90 forbids variable length array ‘buf’ [-Wvla]
warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
@xiaoxiang781216 xiaoxiang781216 merged commit 5a697c1 into apache:master Jan 21, 2022

while (true)
{
ssize_t avail = read(infd, buf, capacity);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is not a C89 issue. Standard allows this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, "ssize_t avail" was moved not because of C89. I moved it together with moving "ssize_t written" that was C89 related issue. So I moved "ssize_t avail" for uniformity reasons.

@a-lunev a-lunev deleted the fix_netcat_c89_warnings branch January 21, 2022 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants