portable way to get highest bit set?

candycanearter07 <[email protected]> Wed, 11 Oct 2023 01:56:49 -0500
Newsgroups comp.lang.c,alt.comp.lang.c
Organization A noiseless patient Spider
Message-ID <[email protected]>
Hi,

What is the best/most portable way to get the highest bit set?

ie. 011010001
to  010000000
-- 
user <candycane> is generated from /dev/urandom