Answer proposed by @Shawn works - the trick is to use [read stdin]
and not [gets stdin]
Correct answer for lint.tcl content :
#! /usr/bin/tclsh
set a [split [read stdin] \n]
puts [llength $a]
pipe command remains same:
grep -ri --color -n WRN warnings.log | lint.tcl