lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130403150809.GC3401@unicorn.suse.cz>
Date:	Wed, 3 Apr 2013 17:08:09 +0200
From:	Michal Kubecek <mkubecek@...e.cz>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	Chen Gang <gang.chen@...anux.com>, fengguang.wu@...el.com,
	isdn@...ux-pingi.de,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>, Joe Perches <joe@...ches.com>
Subject: Re: [Suggestion] ISDN: isdnloop:  C grammar issue,  '}' miss match
 'if' and 'switch' statement.

On Wed, Apr 03, 2013 at 07:31:17AM -0700, Eric Dumazet wrote:
> On Wed, 2013-04-03 at 16:08 +0200, Michal Kubecek wrote:
> 
> > As far as I can see, this rather comes from
> > 
> > commit 475be4d85a274d0961593db41cf85689db1d583c
> > Author: Joe Perches <joe@...ches.com>
> > Date:   Sun Feb 19 19:52:38 2012 -0800
> > 
> >     isdn: whitespace coding style cleanup
> 
> And what is the problem exactly ?
> 
> # make drivers/isdn/isdnloop/isdnloop.o
>   ...
>   CC [M]  drivers/isdn/isdnloop/isdnloop.o
> 
> No error here.

I just checked that gcc (surprisingly - at least for me) accepts

	switch(a) {
	case 1:
		if(...) {
			do_something();
			break;
		case 2:
			...
			break;
		default:
			...
			break;
		}
	}

and it seems to work the same as

	switch(a) {
	case 1:
		if(...) {
			do_something();
		}
		break;
	case 2:
		...
		break;
	default:
		...
		break;
	}

However, I can't think of a reason to use the former.

Michal Kubecek

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ