Page MenuHomeFreeBSD

Build getty(8) with WARNS=6
ClosedPublic

Authored by trasz on Feb 4 2018, 8:06 PM.
Tags
None
Referenced Files
F105960973: D14197.diff
Mon, Dec 23, 3:53 AM
Unknown Object (File)
Sat, Dec 7, 2:50 PM
Unknown Object (File)
Tue, Dec 3, 4:25 AM
Unknown Object (File)
Oct 25 2024, 10:39 AM
Unknown Object (File)
Sep 26 2024, 5:13 PM
Unknown Object (File)
Sep 25 2024, 2:50 PM
Unknown Object (File)
Sep 22 2024, 9:13 PM
Unknown Object (File)
Sep 22 2024, 1:23 PM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

libexec/getty/chat.c
273 ↗(On Diff #38860)

you convert unsigned char * to char * by doing this.

libexec/getty/main.c
263 ↗(On Diff #38860)

32 looks wrong here. It's likely not entirely incorrect, since 32 is > 0, but is a left-over from old-school int days.

712 ↗(On Diff #38860)

why not make i size_t?

719 ↗(On Diff #38860)

and that would save the cast here...

libexec/getty/subr.c
75 ↗(On Diff #38860)

where does this get freed?

121 ↗(On Diff #38860)

dba[0] doesn't look to be freed by all the return paths in the switch above.

trasz added inline comments.
libexec/getty/chat.c
273 ↗(On Diff #38860)

Well, the old code did the same. I'm trying to minimize the differences as much as possible, as I have rather limited way of testing this, and I'd rather avoid breaking something due to "cleanup".

libexec/getty/main.c
263 ↗(On Diff #38860)

True. Still, I'd like to change it as little as possible. Or perhaps just fix it in a separate commit?

Some of the improvements suggested by imp@.

libexec/getty/chat.c
273 ↗(On Diff #38860)

True. But we'll be fighting this in the future since compilers are getting pickier and pickier...

libexec/getty/main.c
263 ↗(On Diff #38860)

works for me.

So, does it look reasonable enough to get accepted? Thanks!

libexec/getty/chat.c
273 ↗(On Diff #38860)

Indeed - but it will be much easier (and safer) to do when we have a proper warnings for those.

(Note to self: tinderboxed.)

Should have ticked OK sooner. There's some issues, as noted, but the new bugs introduced have been fixed so they can wait for another day.

This revision is now accepted and ready to land.Feb 21 2018, 3:38 PM
This revision was automatically updated to reflect the committed changes.