Argument unused warnings


(Daniel Dunbar) #1

Something broke yesterday causing Swift to report gobs of argument unused warnings, see:
  https://bugs.swift.org/browse/SR-1546
for a reference.

Does anyone know who this should go to?

- Daniel


(Dmitri Gribenko) #2

https://github.com/apple/swift/commit/3549ec540408d760c255a526b1cff85644cb96d5 ?

Dmitri

···

On Tue, May 17, 2016 at 12:37 PM, Daniel Dunbar via swift-dev <swift-dev@swift.org> wrote:

Something broke yesterday causing Swift to report gobs of argument unused warnings, see:
  https://bugs.swift.org/browse/SR-1546
for a reference.

Does anyone know who this should go to?

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(Chris Lattner) #3

Right, this is intentional behavior as part of SE-0047: https://github.com/apple/swift-evolution/blob/master/proposals/0047-nonvoid-warn.md

It was a bug that calls to these non-void methods didn’t warn before. They can be marked with the @discardableResult attribute if that makes sense.

-Chris

···

On May 17, 2016, at 1:25 PM, Dmitri Gribenko via swift-dev <swift-dev@swift.org> wrote:

On Tue, May 17, 2016 at 12:37 PM, Daniel Dunbar via swift-dev > <swift-dev@swift.org> wrote:

Something broke yesterday causing Swift to report gobs of argument unused warnings, see:
https://bugs.swift.org/browse/SR-1546
for a reference.

Does anyone know who this should go to?

https://github.com/apple/swift/commit/3549ec540408d760c255a526b1cff85644cb96d5 ?


(Daniel Dunbar) #4

Great, thanks. IMHO it would be nice to open a bug on Foundation/SwiftPM/XCTet when changes like this go in just so we know of the intentional change we need to react to, it is sometimes hard to keep up with the language changes without notification.

- Daniel

···

On May 17, 2016, at 9:25 PM, Chris Lattner <clattner@apple.com> wrote:

On May 17, 2016, at 1:25 PM, Dmitri Gribenko via swift-dev <swift-dev@swift.org> wrote:

On Tue, May 17, 2016 at 12:37 PM, Daniel Dunbar via swift-dev >> <swift-dev@swift.org> wrote:

Something broke yesterday causing Swift to report gobs of argument unused warnings, see:
https://bugs.swift.org/browse/SR-1546
for a reference.

Does anyone know who this should go to?

https://github.com/apple/swift/commit/3549ec540408d760c255a526b1cff85644cb96d5 ?

Right, this is intentional behavior as part of SE-0047: https://github.com/apple/swift-evolution/blob/master/proposals/0047-nonvoid-warn.md

It was a bug that calls to these non-void methods didn’t warn before. They can be marked with the @discardableResult attribute if that makes sense.

-Chris