Re: Building with cmake (was Re: GTKPOD 1.0.0 scripts on FreeBSD current)

Daniele Forsi <[email protected]> Thu, 19 Jul 2012 15:23:34 +0200
Newsgroups gmane.comp.ipod.gtkpod
Message-ID <CAN_we7O=zGqObK1Am+DJNP4YtyasmDHDhDn9QK9ROHeP_L7dWg@mail.gmail.com>
2012/7/19 Hans Petter Selasky:

> Declaring variables inside a for loop is a C++ feature, not a C feature ??

it's C++ and C99 section "6.8.5 Iteration statements"

> At least the compiler over here: cc (GCC) 4.2.1 20070831 patched [FreeBSD]
>
> Complained.

only on that line?
I'm asking because also declaring the variable in the middle of the
code is a C++ and C99 feature and similar code is used in several
places:

$ grep "for (" . -rn --include=*.c | grep int
./libgtkpod/gtkpod_app_iface.c:640:            for (gint i = 0; i <
g_list_length(gp_iface->track_commands); ++i) {
./plugins/sorttab_display/sorttab_widget.c:336:    for (gint i = 0; i
< ST_CAT_NUM; ++i) {
./plugins/sorttab_display/display_sorttabs.c:69:    for (gint i = 0; i
< sort_tab_total; ++i) {
./plugins/clarity/clarity_canvas.c:598:    for (gint i = 0; i <
g_list_length(priv->covers); ++i) {
./plugins/playlist_display/display_playlists.c:1073:    for (gint i =
0; i < g_list_length(playlists); ++i) {

-- 
Daniele Forsi

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/