Bug 6759 - mount.cifs: remove redundant casts
mount.cifs: remove redundant casts
Status: RESOLVED INVALID
Product: Samba 3.5
Classification: Unclassified
Component: Client Tools
unspecified
x64 Linux
: P3 trivial
: ---
Assigned To: Jeff Layton
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-25 03:13 UTC by Jan Engelhardt
Modified: 2009-09-25 03:49 UTC (History)
1 user (show)

See Also:


Attachments
Patch to remove redundant casts in mount.cifs client tool (7.43 KB, text/plain)
2009-09-25 03:14 UTC, Jan Engelhardt
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Engelhardt 2009-09-25 03:13:51 UTC
-
Comment 1 Jan Engelhardt 2009-09-25 03:14:34 UTC
Created attachment 4740 [details]
Patch to remove redundant casts in mount.cifs client tool

Also pullable from the 'cifs' branch

  git://dev.medozas.de/samba cifs
Comment 2 Volker Lendecke 2009-09-25 03:17:19 UTC
I don't think these casts are redundant. They are part of removing C++
warnings. From time to time I compile Samba with g++ which has a lot better
warnings than gcc. And g++ does not accept the implicit cast from void * to
char *. Or am I getting something wrong here?

Volker
Comment 3 Jan Engelhardt 2009-09-25 03:31:21 UTC
>From time to time I compile Samba with g++

What a killer argument :-o

>And g++ does not accept the implicit cast from void * to char *

No, because C++ is not C. That is a bit like... throwing a Java compiler at it and then adding casts for conversions from float to int.
Not sure what to think of that.

What _could possibly_ work is using static_cast() from http://tinyurl.com/yarr9pt , which provides static_cast<> semantics in C instead of the traditional (cast *) which acts like an error-hiding reinterpret_cast<> instead.
Comment 4 Volker Lendecke 2009-09-25 03:49:46 UTC
Well, if you need to force this patch into Samba against many patches that have gone into Samba over the last years to make it compile with C++, please discuss this on samba-technical.

Thanks,

Volker