Linux-Advocacy Digest #608, Volume #33 Sat, 14 Apr 01 15:13:03 EDT
Contents:
Re: there's always a bigger fool ("Ayende Rahien")
Re: Microsoft: Closed source is more secure ("Kelsey Bjarnason")
Re: Has Linux anything to offer ? (Tim Hanson)
Re: Need your recommendation for a full-featured text editor (Eric Taylor)
Re: Something cool in gcc (The Ghost In The Machine)
Re: Something like Install Shield for Linux? (Chronos Tachyon)
Re: Something cool in gcc (The Ghost In The Machine)
Re: A mentality problem of linux programmer. ("Kelsey Bjarnason")
Re: Linux = CHOICE! (The Ghost In The Machine)
Re: Linux on Compaq...coming this Summer. ("WGAF")
Re: Something cool in gcc (mlw)
Re: Something cool in gcc (mlw)
Re: To Eric FunkenBush ("JLI")
Re: Something cool in gcc (mlw)
Re: Something cool in gcc (mlw)
Re: Linux = CHOICE! (Bob Hauck)
----------------------------------------------------------------------------
From: "Ayende Rahien" <[EMAIL PROTECTED]>
Crossposted-To: alt.destroy.microsoft,comp.os.ms-windows.advocacy
Subject: Re: there's always a bigger fool
Date: Sat, 14 Apr 2001 20:57:41 +0200
"Johan Kullstam" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Chris Ahlstrom <[EMAIL PROTECTED]> writes:
>
> > Kelsey Bjarnason wrote:
> > >
> > > Umm... the registry is not the reason apps require reboots.
> >
> > You're right... its often the reason for the Blue Screen of Doh!
> >
> > > Generally
> > > speaking, there are three reasons an install wants to reboot:
> > >
> > > 1) It has attempted to update a locked file, such as a system file.
> >
> > Then stop the services that are using the file first. If the services
> > are network services, "telinit 1" would do the trick.
>
> bringing a unix box down to single user mode (which is what telinit 1
> does unless you have a non-standard configuration) is near to
> rebooting. you kick all users off, terminate their processes and stop
> nearly all services. while the box is not technically rebooted, it
> *is* an interruption of normal operations.
>
Interesting, sound like what I would imagine happening if someone shutdown
the Win32 layer on NT.
Any idea how this can be done, and what the results would be?
------------------------------
From: "Kelsey Bjarnason" <[EMAIL PROTECTED]>
Subject: Re: Microsoft: Closed source is more secure
Date: Sat, 14 Apr 2001 18:03:09 GMT
"David Utidjian" <[EMAIL PROTECTED]> wrote in message
news:9b9ome$r22$[EMAIL PROTECTED]...
> In article <[EMAIL PROTECTED]>, "Ray Chason"
>
> > Ah yes, extensive testing, which is why such glaring boners as the
> > ILOVEYOU/Melissa vulnerability got out the door.
>
> I think those vulnerabilities were "designed in"... aren't they embedded
> VB scripts in email? If they are then... I am sure MS did extensive
> testing to make sure that VB works well with Outlook and all their other
> apps. Windows will, as long as they allow the simple opening of an email
> to execute arbitrary attached code, allwyas have a security problem by
> design.
Depends what one means by "security problem", though. If I hand you off an
executable file or a script and you run it on your Linux box without even
looking at it, can it not, at the least, wipe out or corrupt any and all of
your personal files - i.e. anything you have write access to?
Of course it can. Which means Linux also has a "security problem by design"
and always will. However, the problem isn't the OS, it's the _users_.
The only significant difference I see (and yes, it is a big one) is that
with Win9x versions, you can also trash things other than your personal
files.
This is, of course, one reason why businesses should have been running NT or
2K on the workers' desktops; with those, you can prevent users doing such
damage.
------------------------------
Date: Sat, 14 Apr 2001 11:03:07 -0700
From: Tim Hanson <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: Has Linux anything to offer ?
Karel Jansens wrote:
>
> Tim Hanson wrote:
> >
> >
> > I think 7.0 was the first to come up with DVD, and they included it in
> > the box with the seven CDs. Before installing 7.1 I got a DVD just for
> > this reason, and I'm really glad I did. Now I just leave the DVD in the
> > drive - no more CD swapping when I want to install or uninstall
> > something.
>
> Are you certain about 7.0 being the first SuSE distro that included a
> DVD? I wrote IIRC because I don't own a DVD and I only ever got the demo
> version of 6.4, but ISTR that a big fuss was made over the fact that
> SuSE had the audacity to include a DVD in their distro.
>
> It's no big deal I guess, but I like to keep track of those early
> symptoms of Alzheimer <G>.
>
My memory isn't any better than yours; I make it a practice to give away
past versions of SuSE to some aspiring newbie, so I don't have 6.4
around anymore. Add to it that I didn't have a DVD player at the time,
so any disk wouldn't have been used. I did call the person to whom I
gave the distro; she said there was no DVD. One of us would have to
have to have thrown the DVD and jewel box (for 7.0 there was a separate
jewel box) away, and we're both sure we didn't. FWIW. <shrug>
I _do_ know that the convenience of having it all on one disk is worth
the price of the player, and then some. :-)
--
QUOTE OF THE DAY:
`
______________________________________________________________________
Posted Via Uncensored-News.Com - Still Only $9.95 - http://www.uncensored-news.com
With Seven Servers In California And Texas - The Worlds Uncensored News Source
------------------------------
From: Eric Taylor <[EMAIL PROTECTED]>
Crossposted-To:
24hoursupport.helpdesk,alt.comp.shareware.programmer,comp.editors,comp.lang.java.help,comp.lang.java.programmer,comp.lang.java.softwaretools,comp.os.linux.development.system
Subject: Re: Need your recommendation for a full-featured text editor
Date: Sat, 14 Apr 2001 18:04:36 GMT
Ok, this is going to sound crazy, but I actually do this:
I need to work on linux, windows, and mac. So, I have 3 systems,
networked. I cannot get away with just a single text editor. So...
1. When on linux at the workstation, I never need to do heavy editing,
so I try to use gedit. In a pinch, I actually use 'ed' since I never
learned vi, and i've used ed for over 20 years, which exists on
every unix box and is good for making a 1 or 2 line change. Mostly
I use this when coming in over telnet. Knowing ed means you also know
sed.
2. For C development, I try to develop on my windows box using
(sorry) MICROSOFT VIS C version 6. As an environment, I have never seen
anything better. I have toolbar macros that generate all common
programming fragments, like for loops, if-elseif-else blocks etc.
Dragging and dropping text is a must, and the automatic parameter
fill-in etc. goes way beyond a text editor. The ability to locate
all uses of a variable etc. is necessary, now that my brain is getting
too old to remember. And doing greps is just too hard a way to find
things.
The browsing windows along with the "go back" button makes programs look
like hypertext.
I've even used it as just an editor where I load/save my file to a nfs
exported
linux disk, since it is a superb editor even w/o the browse feature.
It actually seems to be always scanning my code since as soon as I add
a structure or class, it knows about it and can prompt me with the
structure or class members even w/o compiling.
3. And sometimes I use a program called BBEDIT on the mac. It has
load/save
over ftp and supports lots of html type editing. It also has about the
best file differencing I've yet seen. It lets you compare files,
directories,
etc. and then gives you a summary window where you can see all the
differences
and by clicking on a line it brings up 2 source windows side by side
with a third
window showing all diffeences and as you scroll down adjusts the 2
source
windows to show what changed. A couple of buttons lets you choose what
changes you want (e.g. I want to apply a difference in one file into
the other file - useful when 2 people have been changing the same file).
It has syntax coloring for languages like c,perl, etc. It understands
functions or
procedures in the various languages and creates a menu popup with
all the functions/procedures etc. This is a program I wish was portable
to the pc or linux, though it does understand the 3 line terminator
styles.
So, given your list of requirements, I don't think there is really
any single product out there that would serve your needs, but if you
can figure out how to make your files system independent (mostly by
understanding the different line terminators) and can access them
over the net, then I think you can get close to what you want.
Knowledge Seeker wrote:
>
> Hi,
>
> I am looking for a full-featured yet easy to use text editor to
> replace Notepad. Ideally, I would like a tool that is cross-platform
> or has versions for Win98 and Linux. The main platform requirement
> would be Win98 and the nice-to-have platform is Linux.
>
> There seem to be a plethora of choices that might work:
> UltraEdit
> TextPad
> EditPlus
> WinEdit
> Multi-Edit
> Zeus
> CRiSP
>
> Right now I am leaning to UltraEdit but I have not done a true
> rigorous evaluation. I would definitely like to hear from anybody
> that has done a true objective comparative evaluation of these
> products (or others that I have not listed).
>
> My actual requirements are:
>
> Must haves:
> 1. Syntax highlighting (with color and or font) for HTML and Java
> 2. Robust cut and paste including row, AND column AND block
> capabilities
> 3. Split and join functions based on margin or specified column
> 4. Ability to intelligently remove prefix characters (i.e. ">") and
> re-format text to new margins keeping paragraphs intact (i.e. fixing
> forwarded email text)
> 5. Ability to edit multiple files side-by-side
> 6. Ability to compare files and synchronize multiple similar files
> flagging differences
> 7. Robust search and replace capabilities (ideally supporting
> regular expressions)
> 8. Line numbering
> 9. Column numbering
> 10. Auto-completion (based on customizable template)of common
> programming statements
> 11. Ability to preview HTML pages (including Java applets) easily
> 12. HTML toolbar (I know I should know all the tags but I just cannot
> remember them all)
> 13. Can be used as a replacement for Notepad (so it must be
> relatively quick and have a small footprint)
> 14. Highlights URL and e-mail addresses and launches browser or email
> client in a separate window when clicked
> 15. Ability to change case for entire selected text
> 16. Auto indent based on user-defined templates for each programming
> language
> 17. Auto alignment (I.e. if I want a set of lines with the "=" sign
> or decimal point or comma aligned on multiple rows)
> 18. Undo capability
>
> Nice to haves:
> 1. Syntax highlighting for Perl, C/C++, and SQL. Also, extensibility
> for other programming languages based on easily customized syntax
> files.
> 2. Ability to use FTP
> 3. Spell checker
> 4. Ability to compile from within the editor
> 5. Keystroke save/execute (i.e. macro capability)
>
> --
> eCommerce Knowledge Seeker
------------------------------
From: [EMAIL PROTECTED] (The Ghost In The Machine)
Subject: Re: Something cool in gcc
Date: Sat, 14 Apr 2001 18:07:23 GMT
In comp.os.linux.advocacy, mlw
<[EMAIL PROTECTED]>
wrote
on Sat, 14 Apr 2001 07:07:48 -0400
<[EMAIL PROTECTED]>:
>Erik Funkenbusch wrote:
>> Why don't you instead, write standard C++ like this:
>>
>> const int len = strlen(string)+1;
>> char var[len];
>>
>> Much easier and fully standard conforming.
>
>Are you kidding?
>
>If "string" is a variable, "len" can't be a constant.
Why not?
len is a local variable, which is defined at the point of the
program at which it is declared.
Consider the following:
int somethingToDo(const char * ptr)
{
const int len = strlen(ptr);
/*...*/
}
This is a perfect example of what I might call "the unknown constant".
The compiler cannot know len's value, but does know it's non-modifiable,
within the confines of somethingToDo(). (The same issues apply to
the argument 'ptr'.)
OK, so one might quibble here. It's bad enough that this is a
non-constant constant (my mind hurts already); it gets worse with
constructs such as 'mutable' in C++. But these sort of ideas have
been around for awhile, even in assembly language; a symbolic label
is basically an unknown constant (until link time, anyway, and maybe
not even then).
But it works. :-) I'll admit I'm not sure of its portability, however.
>
>--
>I'm not offering myself as an example; every life evolves by its own laws.
>------------------------
>http://www.mohawksoft.com
--
[EMAIL PROTECTED] -- insert random misquote here
EAC code #191 8d:09h:45m actually running Linux.
You were expecting something relevant down here?
------------------------------
From: Chronos Tachyon <[EMAIL PROTECTED]>
Subject: Re: Something like Install Shield for Linux?
Date: Sat, 14 Apr 2001 18:08:16 GMT
Just a quick comment...
On Sat 14 Apr 2001 12:02, Kelsey Bjarnason wrote:
[Snip]
>>
>> No, because you are comparing unlike things to make MS look good. I did
>> not know what MSI is/was and you presented it as an alternative to RPM.
>> It is apparently not that, but some sort of enterprise management tool.
>
> What does RPM do? It installs products. What does MSI do? It installs
> products. That RPM is woefully lacking in supporting the range of things
> that "installing products" can actually involve isn't my problem, but
> RPM's.
>
[Snip]
Not quite. RPM installs products. MSI installs parts of products, plus
hooks that install the rest of the product on demand. I would be quite
shocked if this didn't require massive hooks into every single
MSI-compatible application, whereas you can just slap any old program into
an RPM (or an InstallShield).
--
Chronos Tachyon
Guardian of Eristic Paraphernalia
Gatekeeper of the Region of Thud
[Reply instructions: My real domain is "echo <address> | cut -d. -f6,7"]
------------------------------
From: [EMAIL PROTECTED] (The Ghost In The Machine)
Subject: Re: Something cool in gcc
Date: Sat, 14 Apr 2001 18:15:21 GMT
In comp.os.linux.advocacy, mlw
<[EMAIL PROTECTED]>
wrote
on Sat, 14 Apr 2001 11:51:47 -0400
<[EMAIL PROTECTED]>:
>Chronos Tachyon wrote:
>>
>> On Sat 14 Apr 2001 06:19, mlw wrote:
>>
>> [Snip]
>> >
>> > It amazes me that people draw such a distinction between C++ from C.
>> >
>> > function(char *str)
>> > {
>> > printf("%s\n", str);
>> > }
>> >
>> > The above function is perfectly valid C++ code. It is also perfectly valid
>> > C code.
>> >
>> [Snip]
>>
>> You are incorrect here. That code is neither legal C nor legal C++, but
>> for different reasons. In C, if you don't explicitly declare a return type
>> for a function, it defaults to returning an int; the function above has no
>> return statement, so you're returning an undefined value (most likely,
>> either the return value of printf, or 0). In C++, not declaring a return
>> type is illegal.
>
>Oops, yes, that is right. I was not talking about the return type, I was
>talking about the structure of the function, lacking the return was a typo.
>(The compiler would have gotten it)
>
>void function(char *str)
>{
> printf("%s\n", str);
>}
>
>How's that? It is a valid function in both C and C++.
Pedant point. printf() returns an int, which is then discarded;
the compiler might issue a warning. (gcc -ansi -pedantic -Wall -Wsynth
doesn't seem to care, but I think an HP compiler that had better
error checking (it caught a *lot* of things most other compilers
wouldn't) might.)
One can do something like
(void) printf("%s\n", str);
but few bother, AFAIK.
>
>One need not go overboard with iostreams and crap like that in C++ if they
>desire not.
>
>My point is C++ is a superset of C.
Except for various minor issues, definitely. Like:
int func1(int x)
{
/* ... */
}
int main()
{
func1("duh");
return 0;
}
compiles and links in C, but not C++, because of name mangling.
(Good thing, too. You wouldn't believe how many headaches we
had to fix in our code some years back because of sloppy
prototype coding -- exacerbated by putting the prototypes in .C files --
that got caught because of this. The fact we had an automated
Pascal => C/C++ converter introduced its own weirdies. :-) )
>
>> --
>> Chronos Tachyon
>> Guardian of Eristic Paraphernalia
>> Gatekeeper of the Region of Thud
>> [Reply instructions: My real domain is "echo <address> | cut -d. -f6,7"]
>
>--
>I'm not offering myself as an example; every life evolves by its own laws.
>------------------------
>http://www.mohawksoft.com
--
[EMAIL PROTECTED] -- insert random misquote here
EAC code #191 8d:10h:00m actually running Linux.
We are all naked underneath our clothes.
------------------------------
From: "Kelsey Bjarnason" <[EMAIL PROTECTED]>
Subject: Re: A mentality problem of linux programmer.
Date: Sat, 14 Apr 2001 18:16:56 GMT
[snips]
"Aaron R. Kulkis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> JLI wrote:
> This is correct.
>
> Setting an environment is such a trivial thing to do that even
> the most ignorant users know how to do it.
Well, let's tke the wife as an example here.
She's been using a computer for, oh, 5 years give or take. She plays games,
does word processing, does web design, updates user lists, tracks order
processing, all the sorts of things a user needs to (or wants to) do. She
hasn't got a clue how to set an environment variable. Why would she? In
her entire computing experience, she has never, once, had a need to do so.
Why would "even the most ignorant user" know how to do something they have
never had a single reason to do?
------------------------------
From: [EMAIL PROTECTED] (The Ghost In The Machine)
Crossposted-To: soc.singles
Subject: Re: Linux = CHOICE!
Date: Sat, 14 Apr 2001 18:21:19 GMT
In comp.os.linux.advocacy, George Davenport
<[EMAIL PROTECTED]>
wrote
on Sat, 14 Apr 2001 06:26:06 -0700
<arYB6.698$[EMAIL PROTECTED]>:
>Matthew Gardiner <[EMAIL PROTECTED]> wrote
>>
>> <snype>
>>
>> True, and isn't it great when a distro makes a really fucking
>> awful distro you have the opportunity to goto another vendor,
>> and you can keep changing until you find one that suites your
>> needs.
>
>linux slut
http://www.stileproject.com/lls.html
:-)
(Not for anyone under 18 or lacking a sense of humor.)
[rest snipped]
--
[EMAIL PROTECTED] -- insert random misquote here
EAC code #191 8d:10h:12m actually running Linux.
This is the best part of the message.
------------------------------
From: "WGAF" <[EMAIL PROTECTED]>
Crossposted-To: alt.destroy.microsoft,comp.os.ms-windows.advocacy,soc.singles
Subject: Re: Linux on Compaq...coming this Summer.
Date: Sat, 14 Apr 2001 18:23:39 GMT
"Aaron R. Kulkis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> WGAF wrote:
> >
> > "Aaron R. Kulkis" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]...
> > > WGAF wrote:
> > > >
> > > > "Aaron R. Kulkis" <[EMAIL PROTECTED]> wrote in message
> > > > news:[EMAIL PROTECTED]...
> > > >
> > > > > > i defend a company's right to sell products on whatever terms
they
> > can
> > > > > > negotiate with vendors and consumers.
> > > > >
> > > > > Signing deals in which you siphon money from the sale of one
> > > > > company's product into the coffers of their competitor is ILLEGAL.
> > > > >
> > > >
> > > > No it's not. AMD is still paying royalties to Intel for every AMD
CPU
> > sold.
> > >
> > > When Company A makes a deal with Company B, specifying that proceeds
of
> > > sales of products from company C will be diverted to Company A, that's
> > illegal.
> >
> > And when company B makes a long term contract with company A based upon
the
> > hardware sold to get a lucrative deal on company A's product and then
starts
> > to sell company C's product, then company B is still under a contract
with
> > company A. And as such company B needs to fulfill their contractual
> > agreement with company A. You incorrectly call it "illegal", which is
not if
> > the actual contract was made prior to company B selling company C's
product.
> > You might call it bad decision on company B's part but that's about it.
I
> > fail to see the illegal part.....
>
> Per Processor licensing is ILLEGAL.
>
> If it wasn't, then there wouldn't have been a FELONY CONVICTION for it.
>
> That's the FUCKING LAW, you twit.
That's one law what I have not seen in the lawbooks, is that a Unix book
where you've seen it you moron?
------------------------------
From: mlw <[EMAIL PROTECTED]>
Subject: Re: Something cool in gcc
Date: Sat, 14 Apr 2001 14:36:24 -0400
Kelsey Bjarnason wrote:
>
> [snips]
>
> "mlw" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
>
> > (The compiler would have gotten it)
> >
> > void function(char *str)
> > {
> > printf("%s\n", str);
> > }
> >
> > How's that? It is a valid function in both C and C++.
> >
> > One need not go overboard with iostreams and crap like that in C++ if they
> > desire not.
> >
> > My point is C++ is a superset of C.
>
> Then your point is wrong, plain and simple.
How so?
--
I'm not offering myself as an example; every life evolves by its own laws.
========================
http://www.mohawksoft.com
------------------------------
From: mlw <[EMAIL PROTECTED]>
Subject: Re: Something cool in gcc
Date: Sat, 14 Apr 2001 14:37:06 -0400
Chronos Tachyon wrote:
>
> On Sat 14 Apr 2001 10:51, mlw wrote:
>
> [Snip]
> >
> > Oops, yes, that is right. I was not talking about the return type, I was
> > talking about the structure of the function, lacking the return was a
> > typo. (The compiler would have gotten it)
> >
> > void function(char *str)
> > {
> > printf("%s\n", str);
> > }
> >
>
> Yep, much better :-). I'd figured it was probably a typo in the first
> place, but what the heck.
>
> > How's that? It is a valid function in both C and C++.
> >
> > One need not go overboard with iostreams and crap like that in C++ if they
> > desire not.
> >
> > My point is C++ is a superset of C.
> >
>
> Well, it does still bring up the interesting point that the following code
> snippet is legal C but not C++:
>
> function(char *str)
> {
> printf("%s\n", str);
> return 0;
> }
>
> But that is, of course, just nitpicking.
Yes, but one would call a function without a declared return type "bad form."
--
I'm not offering myself as an example; every life evolves by its own laws.
========================
http://www.mohawksoft.com
------------------------------
From: "JLI" <[EMAIL PROTECTED]>
Subject: Re: To Eric FunkenBush
Date: Sat, 14 Apr 2001 18:35:56 GMT
I still don't know what is the problem in plain english. It seems to be
related to
the namespace. In this respect i would point out the following for your
information:
- gcc doesn't really support namespace. It just ingores the statememt "using
namespace std;".
gcc simpliy puts all names into the std namespace. This is a serious
problem with gcc.
- VC++ implements the namespace properly, and there are two sets of stream
libraries with
VC++: functions declared in iostream.h, ifstream.h are in the default
non-name namespace;
functions delcared in files iostream, ifstream (without extension) are in
the std namespace.
The second set is more standard compliant.
- Removing the statement "using namesapce std" has no effect with GCC.
But with VC++, this change will cause the code to pick-up the no standard
stream functions.
So the solution presented here indicates the sample code relies on certain
features of
no standard stream library.
JLI
Erik Funkenbusch <[EMAIL PROTECTED]> wrote in message
news:_cUB6.3189$[EMAIL PROTECTED]...
> Actually, it has nothing to do with templates. This is a bug with friend
> functions combined with the using declaration, which have had some known
> issues.
>
> In any event, the issue here has nothing to do with MI, as you claimed.
If
> you knew much about C++, you'd know this, and you could have recreated it
in
> a much smaller sample.
>
> You can recreate it in the following simple code that doesn't use MI at
all.
> To make it work, comment out the #include and the using namespace std:
>
> #include <iostream>
> using namespace std;
> class S
> {
> public:
> private:
> int a;
> friend bool operator>(const S& s1, const S& s2);
> };
>
> bool operator>(const S& s1, const S& s2){return s1.a > s2.a;}
>
> "Erik Funkenbusch" <[EMAIL PROTECTED]> wrote in message
> news:OOTB6.3188$[EMAIL PROTECTED]...
> > Your example uses templates. That is most likely the issue, not the MI.
> VC
> > is a pre-standard compiler, and as such cannot be expected to conform to
a
> > standard that did not exist when it was written.
> >
> > I'll compile them and see.
> >
> > "GreyCloud" <[EMAIL PROTECTED]> wrote in message
> >
news:[EMAIL PROTECTED]...
> > > I've found the programs in the book "C++ Primer Plus" by Stephen
Prata.
> > >
> > > See attached source code.
> >
> >
> >
>
>
------------------------------
From: mlw <[EMAIL PROTECTED]>
Subject: Re: Something cool in gcc
Date: Sat, 14 Apr 2001 14:47:24 -0400
Kelsey Bjarnason wrote:
>
> "mlw" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > Kelsey Bjarnason wrote:
> >
> > > Or it was actually compiled as C code and gcc is trying to support C99
> > > features. Note the OP said "C/C++" - some mythical language nobody's
> ever
> > > heard of - but it sure as hell _looks_ like C code, not C++ code.
> >
> > It amazes me that people draw such a distinction between C++ from C.
> >
> > function(char *str)
> > {
> > printf("%s\n", str);
> > }
> >
> > The above function is perfectly valid C++ code. It is also perfectly valid
> C
> > code.
>
> Yup. #include <stdio.h> however is strictly C. Also, printf is generally
> discouraged in C++, since it isn't typesafe, while cout is typesafe.
That's bull. It may not be "type safe" but the only people that discourage it
are the fractious OOP fanatics.
> >
> > typedef struct _stuff
> > {
> > int a;
> > int b;
> > char datum[1];
> > }STUFF, *PSTUFF;
> >
> > The above structure definition is perfectly valid in C and C++.
>
> It is? I thought _stuff would break a rule about reservered identifiers.
>
Note that I've ever read or seen.
> > Aside from some very obscure differences, C++ is a superset of C.
>
> Obscure? Let's see:
>
> /* file1.c */
> #include <stdio.h>
> #include <stdlib.h>
>
> int main(int new, char **class)
> {
> double *d;
> d = malloc( 100 * sizeof *d );
> if ( d ) free ( d );
> return 0;
> }
>
> Let's see; <stdio.h> isn't C++. Nor is <stdlib.h>.
Why not?
> The use of new and
> class are perfectly valid in C. Try it in C++. Using malloc without a cast
> of the return type is correct C (casting is a bad idea; it masks certain
> conditions which should result in diagnostics) but you cannot use malloc
> without the cast in C++.
Yes, but it is a good practice to cast from a "void *" to the type you want it
to be. Who says casting is a bad idea?
> The
> differences in the results of sizeof('a') might be considered a little more
> obscure, I suppose, given that it's an unusual construct in the first place,
> but the others? Don't think so.
The sizeof operator uses parens, "sizeof type" does not work, it must be
"sizeof(type)." The sizeof() operator is both C and C++.
>
> > So the
> > statement, saying "C/C++" is perfectly valid when discussing features
> common to
> > both. One would not use "C/C++" when discussing classes.
>
> Features such as <stdio.h> ?
Why is not stdio.h part of C++? It can be included, it can be used, no
additional linking specifications need be made.
--
I'm not offering myself as an example; every life evolves by its own laws.
========================
http://www.mohawksoft.com
------------------------------
From: mlw <[EMAIL PROTECTED]>
Subject: Re: Something cool in gcc
Date: Sat, 14 Apr 2001 14:48:16 -0400
Craig Kelley wrote:
>
> mlw <[EMAIL PROTECTED]> writes:
>
> > I did something in gcc, that I thought would make the compiler barf, to prove a
> > point. Instead of proving my point it would not work, it worked. Wow! this is a
> > great feature of gcc.
> >
> > 1 #include <unistd.h>
> > 2 #include <string.h>
> > 3 #include <stdio.h>
> > 4 void function(char *str1, char *str2)
> > 5 {
> > 6 int cb = strlen(str1)+strlen(str2)+1;
> > 7 char str[cb];
> > 8 strcpy(str,str1);
> > 9 strcat(str,str2);
> > 10 printf("%s\n", str);
> > 11 }
> >
> > It isn't standard C/C++ but it could certainly save a malloc or two here and
> > there.
>
> That's legal C++ code, but gcc should balk with the --pedantic flag.
The Microsoft compiler balks at it. VC 6x
--
I'm not offering myself as an example; every life evolves by its own laws.
========================
http://www.mohawksoft.com
------------------------------
From: [EMAIL PROTECTED] (Bob Hauck)
Subject: Re: Linux = CHOICE!
Reply-To: bobh = haucks dot org
Date: Sat, 14 Apr 2001 18:43:40 GMT
On Sat, 14 Apr 2001 13:55:27 GMT, Pete Goodwin
<[EMAIL PROTECTED]> wrote:
> That's because with Windows it just works and there's no need to hop
> vendors.
You can be pretty funny sometimes.
--
-| Bob Hauck
-| To Whom You Are Speaking
-| http://www.haucks.org/
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list by posting to comp.os.linux.advocacy.
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Advocacy Digest
******************************