Saturday, January 25, 2014

comp.lang.c++ - 26 new messages in 5 topics - digest

comp.lang.c++
http://groups.google.com/group/comp.lang.c++?hl=en

comp.lang.c++@googlegroups.com

Today's topics:

* The Beauties of Islam - 12 messages, 6 authors
http://groups.google.com/group/comp.lang.c++/t/b79532a504d8f51e?hl=en
* STL::MAP: Printing values only once .. - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/671080d0fc07abda?hl=en
* Boost - 4 messages, 4 authors
http://groups.google.com/group/comp.lang.c++/t/81738d66827a11c8?hl=en
* Link object files from VC++ and GCC? - 7 messages, 5 authors
http://groups.google.com/group/comp.lang.c++/t/d605f2ea0db15eb9?hl=en
* goto label inside of if statement - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/7c222b0d5330287c?hl=en

==============================================================================
TOPIC: The Beauties of Islam
http://groups.google.com/group/comp.lang.c++/t/b79532a504d8f51e?hl=en
==============================================================================

== 1 of 12 ==
Date: Mon, Jan 20 2014 5:37 pm
From: woodbrian77@gmail.com


On Monday, January 20, 2014 6:49:58 PM UTC-6, Mr Flibble wrote:

Please don't swear here.

Brian
Ebenezer Enterprises - The fool has said in his heart,
"There is no G-d." Psalms 14:1




== 2 of 12 ==
Date: Mon, Jan 20 2014 5:55 pm
From: woodbrian77@gmail.com


On Monday, January 20, 2014 7:37:50 PM UTC-6, woodb...@gmail.com wrote:
> On Monday, January 20, 2014 6:49:58 PM UTC-6, Mr Flibble wrote:
>
> Please don't swear here.
>

http://www.desiringGod.org/interviews/can-christians-cuss-to-prove-a-point#full-audio

https://www.youtube.com/watch?v=_mFaRD3OPHE




== 3 of 12 ==
Date: Tues, Jan 21 2014 1:27 am
From: Juha Nieminen


woodbrian77@gmail.com wrote:
> The C++ Middleware Writer is based on Judeo/Christian roots.
> I'm not aware of C++ work based on Islamic roots.

I think there's something wrong in your brain. Maybe you should have
it checked.

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---




== 4 of 12 ==
Date: Tues, Jan 21 2014 2:23 am
From: "Qu0ll"


wrote in message
news:c2f415a8-d26c-412e-b137-fdacfa93951c@googlegroups.com...

> The C++ Middleware Writer is based on Judeo/Christian roots.
> I'm not aware of C++ work based on Islamic roots.

Brian, we both may identify ourselves as Christians but my response to that
is definitely a big WTF???

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]





== 5 of 12 ==
Date: Tues, Jan 21 2014 4:37 am
From: Victor Bazarov


On 1/21/2014 4:27 AM, Juha Nieminen wrote:
> woodbrian77@gmail.com wrote:
>> The C++ Middleware Writer is based on Judeo/Christian roots.
>> I'm not aware of C++ work based on Islamic roots.
>
> I think there's something wrong in your brain. Maybe you should have
> it checked.

Please don't feed trolls.




== 6 of 12 ==
Date: Tues, Jan 21 2014 11:13 am
From: Bo Persson


Qu0ll skrev 2014-01-21 11:23:
> wrote in message
> news:c2f415a8-d26c-412e-b137-fdacfa93951c@googlegroups.com...
>
>> The C++ Middleware Writer is based on Judeo/Christian roots.
>> I'm not aware of C++ work based on Islamic roots.
>
> Brian, we both may identify ourselves as Christians but my response to
> that is definitely a big WTF???
>

So Brian admits to being ignorant on islamic software, whatever that is.

Who cares?







== 7 of 12 ==
Date: Tues, Jan 21 2014 2:51 pm
From: woodbrian77@gmail.com


On Tuesday, January 21, 2014 3:27:43 AM UTC-6, Juha Nieminen wrote:
> woodbrian77@gmail.com wrote:
>
> > The C++ Middleware Writer is based on Judeo/Christian roots.
> > I'm not aware of C++ work based on Islamic roots.
>
> I think there's something wrong in your brain.
>

Consider these verses from Psalms 121:

"I will lift up my eyes to the mountains;
From where shall my help come?
My help comes from the L-rd,
Who made heaven and earth.
He will not allow your foot to slip;
He who keeps you will not slumber.
Behold, He who keeps Israel
Will neither slumber nor sleep."

G-d is the original server. He's 100% ready.
I turn to G-d and the Bible for inspiration
and understanding when it comes to providing
quality services. I also ask around here for
ideas. G-d has people all over the world.

Maybe we can agree that C++ is an excellent language
for writing services.

Brian
Ebenezer Enterprises - Ask, and it will be given
to you; seek, and you will find; knock, and it will
be opened to you.
http://webEbenezer.net




== 8 of 12 ==
Date: Tues, Jan 21 2014 3:20 pm
From: woodbrian77@gmail.com


On Tuesday, January 21, 2014 4:51:00 PM UTC-6, woodb...@gmail.com wrote:
>
> Consider these verses from Psalms 121:
>
> "I will lift up my eyes to the mountains;
> From where shall my help come?
> My help comes from the L-rd,
> Who made heaven and earth.
> He will not allow your foot to slip;
>

This is another answer to when Leigh asked me about
the possibility of me being hit by a bus. I replied
with the story about Elijah and Elisha, but here we
have supernatural protection so my foot doesn't slip.

And remember how Elijah was treated. He wasn't hit
by a bus, but was whisked away in a flaming chariot.





== 9 of 12 ==
Date: Wed, Jan 22 2014 3:53 am
From: David Brown


On 22/01/14 00:20, woodbrian77@gmail.com wrote:
> On Tuesday, January 21, 2014 4:51:00 PM UTC-6, woodb...@gmail.com wrote:
>>
>> Consider these verses from Psalms 121:
>>
>> "I will lift up my eyes to the mountains;
>> From where shall my help come?
>> My help comes from the L-rd,
>> Who made heaven and earth.
>> He will not allow your foot to slip;
>>
>
> This is another answer to when Leigh asked me about
> the possibility of me being hit by a bus. I replied
> with the story about Elijah and Elisha, but here we
> have supernatural protection so my foot doesn't slip.
>
> And remember how Elijah was treated. He wasn't hit
> by a bus, but was whisked away in a flaming chariot.
>

Are you really claiming that people should trust your code because it is
"inspired by God", and we can trust your company because you have
supernatural powers and will not die, but be "whisked away", and
presumably continue to provide customer service and support from heaven?


I don't really care what you believe in or not - faith is a personal
matter (except when it affects how you treat other people, of course).
If your faith inspires you to work hard and have confidence in the job
you do, then that's great. But the sort of twaddle you posted here has
no place in a business or profession. A piece of software has no faith,
and a company has no religion - you really have to learn to separate
these from yourself. If you can't do that, switch professions - you'll
make far more money as a TV evangelist.







== 10 of 12 ==
Date: Wed, Jan 22 2014 9:32 am
From: woodbrian77@gmail.com


On Wednesday, January 22, 2014 5:53:24 AM UTC-6, David Brown wrote:

> Are you really claiming that people should trust your code because it is

No. The generated code is available to be read by anyone.
The same is true of a lot of the hand written code.

> "inspired by God", and we can trust your company because you have
> supernatural powers and will not die, but be "whisked away", and

I didn't claim that I won't die. Elijah trained Elisha
to do his job and then Elijah was carried away.

>
>
>
> I don't really care what you believe in or not - faith is a personal

Remember "In G-d we trust".


> and a company has no religion

Ebenezer Enterprises does. Would you agree that the US
has Judeo/Christian roots? I'm thinking of the pilgrims
who sailed across the Atlantic and also thinking of modern
day pilgrims like Sean Hannity

http://www.truthrevolt.org/news/sean-hannity-andrew-cuomo-i-cant-wait-leave-new-york





== 11 of 12 ==
Date: Wed, Jan 22 2014 11:24 am
From: David Brown


On 22/01/14 18:32, woodbrian77@gmail.com wrote:
> On Wednesday, January 22, 2014 5:53:24 AM UTC-6, David Brown wrote:
>
>> Are you really claiming that people should trust your code because it is
>
> No. The generated code is available to be read by anyone.
> The same is true of a lot of the hand written code.
>

Making all your source code available to others is good for trust, of
course.

>> "inspired by God", and we can trust your company because you have
>> supernatural powers and will not die, but be "whisked away", and
>
> I didn't claim that I won't die. Elijah trained Elisha
> to do his job and then Elijah was carried away.
>

So you - on the basis of your beliefs in the OT - you are confident of
training a replacement before getting "whisked away" ?

If you are a one-man company, that's fair enough - as long as you are
clear about this to customers, and have appropriate measures in place
(available documentation, source code, license details, etc.) so that
they know how they can continue with their own work if you get hit by a
bus. But when you tell customers that they don't need to worry because
you've got God on your side, and you are the next Elijah, then any sane
customer will laugh at you.

>>
>>
>>
>> I don't really care what you believe in or not - faith is a personal
>
> Remember "In G-d we trust".

If /you/ want to trust in God, that's fair enough - just don't expect
any customers to trust in /your/ trust.

>
>
>> and a company has no religion
>
> Ebenezer Enterprises does.

A company has no religion. It is not a person, it does not have
beliefs. Your problem is that you fail to understand what a company
/is/, and mix it up with yourself.

A company has a /profile/, and that profile can have ethical or moral
standards (as long as they are legal and non-discriminatory) - but that
is not the same as claiming it has a religion.

> Would you agree that the US
> has Judeo/Christian roots?

A lot of the /people/ who formed the modern USA have Christian roots -
though many do not. The "founding fathers" attempted to make a country
where people could be free to follow whatever religion they wanted,
which was a noble aim and certainly /not/ a Christian idea. If
anything, their inspiration was the Roman Empire with its tradition of
tolerance for many peoples and religions.

> I'm thinking of the pilgrims
> who sailed across the Atlantic and also thinking of modern
> day pilgrims like Sean Hannity
>
> http://www.truthrevolt.org/news/sean-hannity-andrew-cuomo-i-cant-wait-leave-new-york
>

It is well-known that the pilgrim fathers left England because of
"religious persecution" - what is less well-known is that it was the
sect left England because /they/ were not allowed to persecute others.
There was far too much religious freedom (i.e., several different
variants of Christianity were allowed) in England for their tastes, and
they wanted to go somewhere where everyone could be forced to follow
/their/ ideas.






== 12 of 12 ==
Date: Wed, Jan 22 2014 3:14 pm
From: woodbrian77@gmail.com


On Wednesday, January 22, 2014 1:24:41 PM UTC-6, David Brown wrote:

>
> So you - on the basis of your beliefs in the OT - you are confident of
> training a replacement before getting "whisked away" ?
>

I'm not saying I'll be whisked away. Just that Elijah
was whisked away.

> If you are a one-man company, that's fair enough - as long as you are
> clear about this to customers, and have appropriate measures in place
> (available documentation,

It would be nice to have some documentation discussions
here. I acknowledge there's room for improvement on
the documentation and welcome specific ideas on how to
improve it. I've been focusing a lot on the software,
and the docs need work.

> source code, license details, etc.) so that
> they know how they can continue with their own work if you get hit by a
> bus. But when you tell customers that they don't need to worry because
> you've got God on your side, and you are the next Elijah, then any sane
> customer will laugh at you.
>

Ample evidence of the quality is available in terms
of both the generated code and hand written code.
There's also this page

http://webEbenezer.net/comparison.html
.

I'm not the next Elijah. I'm learning from his example.

Habakkuk 2:4

"Behold the proud, his soul is not upright in him; but the
just shall live by his faith."

I can give some help to people to make a decision about
using the C++ Middleware Writer, but as with any other
decision there's some risk involved. For those who are
living by faith in G-d it might be an easier decision
to make than for those aren't.

It doesn't hurt that the company has been here since 1999.
Maybe some will admit that making it to 2014 in better
shape than ever is evidence that G-d has helped us.


>
> > Remember "In G-d we trust".
>
> If /you/ want to trust in God, that's fair enough - just don't expect
> any customers to trust in /your/ trust.

In G-d we trust is the national motto of the United States.
We're upfront about our faith in G-d. We let other people
know the source of our strength.

>
>
> A company has no religion. It is not a person, it does not have
> beliefs. Your problem is that you fail to understand what a company
> /is/, and mix it up with yourself.
>

You fail to acknowledge our rights are from G-d.
Remember our name is Ebenezer - that means "So far G-d
has helped us."

Would you expect anything but the best of work
(interesting, rewarding, etc.) for those who follow G-d?

>
> It is well-known that the pilgrim fathers left England because of
> "religious persecution" - what is less well-known is that it was the
> sect left England because /they/ were not allowed to persecute others.

Your understanding is incorrect. They left in order
to follow G-d according to their conscience. I had
to do the same thing when I started a company. I left
behind those companies with immoral policies. If I
were an employee of IBM, Microsoft, Apple, etc. today,
some of the money I helped them make would be going to
support immoral lifestyles. I said, "Thanks, but no
thanks" to that. If you want to lead a G-dly life, it
will cost you some in terms of income. Unfortunately
what is considered "good" by some is evil from G-d's
perspective.

"Woe to those who call evil good, and good evil;
Who substitute darkness for light and light for darkness;
Who substitute bitter for sweet and sweet for bitter!"
Isaiah 5:20

I see this as a King David against Goliath struggle.
G-d blessed David with the victory over the foul-mouthed
Goliath.


Brian
Ebenezer Enterprises
http://webEbenezer.net


http://www.truthrevolt.org/news/sean-hannity-andrew-cuomo-i-cant-wait-leave-new-york





==============================================================================
TOPIC: STL::MAP: Printing values only once ..
http://groups.google.com/group/comp.lang.c++/t/671080d0fc07abda?hl=en
==============================================================================

== 1 of 1 ==
Date: Mon, Jan 20 2014 9:30 pm
From: Seungbeom Kim


On 2014-01-20 11:22, Martijn Lievaart wrote:
> The Perl equivalent:
>
> perl -p -F'|' -e 'print "$F[0] $F[6]"; exit if $.>2;'

OT, but let me correct some obvious errors:

perl -nl -aF'\|' -e 'print "$F[0] $F[6]"; exit if $.>2;'

--
Seungbeom Kim





==============================================================================
TOPIC: Boost
http://groups.google.com/group/comp.lang.c++/t/81738d66827a11c8?hl=en
==============================================================================

== 1 of 4 ==
Date: Tues, Jan 21 2014 1:26 am
From: Juha Nieminen


Herman Viracocha <hermv@idioqm.org> wrote:
> Juha Nieminen wrote:
>
>> Nick Baumbach <nich@iwqoc.org> wrote:
>>> I mean, it has to make things easier, but it does not looks like, since
>>> it takes hours to compile.
>>
>> It does not make things easier because it takes hours to compile?
>
> No? Definitely is not easier. Are you sure you clearly understand "hours
> to compile"?

I'm sure that something like g++ takes quite a long time to compile.
However, that doesn't make it less useful.

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---




== 2 of 4 ==
Date: Tues, Jan 21 2014 2:52 am
From: Öö Tiib


On Monday, 20 January 2014 23:37:32 UTC+2, J. Clarke wrote:

>
> In article <lbk1c9$8sl$1@speranza.aioe.org>, bobhaa@djea.org says...

No. Such person does not exist so he can say nothing. So far it is just

Random Male Name <random letters@random letters.org>

See examples like Herman Viracocha, Bob Hammermann or Nick Baumbach.

> <plonk>

Good luck filling your killfile with random troll-generated names and addresses
and announcing it every time.




== 3 of 4 ==
Date: Tues, Jan 21 2014 5:39 am
From: Martijn Lievaart


On Mon, 20 Jan 2014 20:41:17 +0000, Bob Hammerman wrote:

> J. Clarke wrote:
>
>> What it's good for is avoiding reinventing the wheel. If you have a
>> tested library already available that provides the function that you
>> need with acceptable performance, why rewrite it?
>
> I don't know, but going through reverse engineering other peoples craps
> is more time demanding than going through own crap. Don't you know it,
> where have you been?

Having just debugged a professional well respected open source library, I
can say:

- It's crap
- Debugging it took 1 day, writing this functionality would probably have
taken months, if not a year.

So your statement is not true.

M4




== 4 of 4 ==
Date: Tues, Jan 21 2014 6:59 am
From: Robert Wessel


On Mon, 20 Jan 2014 17:08:48 GMT, scott@slp53.sl.home (Scott Lurndal)
wrote:

>Robert Wessel <robertwessel2@yahoo.com> writes:
>>On Mon, 20 Jan 2014 15:26:52 GMT, scott@slp53.sl.home (Scott Lurndal)
>>wrote:
>>
>>>Nick Baumbach <nich@iwqoc.org> writes:
>>>>Ian Collins oratorically vehemently insists
>>>>
>>>>> On a more up to date machine with gcc:
>>>>>
>>>>> time ./b2 -j 32
>>>>>
>>>>> <stuff>
>>>>>
>>>>> The Boost C++ Libraries were successfully built!
>>>>>
>>>>> real 1m2.319s user 27m57.961s sys 1m49.214s
>>>>
>>>>Wow, -j 32 !! Say no more. Where did you find that 32 since at most I only
>>>>can find 16, as 2 threads per core. Actually thread core, not real core.
>>>>An i7 is still a 4 core, not sure how that threaded core is embedded into
>>>>the hardware.
>>>>
>>>>Please elaborate
>>>
>>>Many larger systems are available. Not too many years ago, I was running
>>>-j384 compiles regularly on a 192-core shared memory system.
>>
>>
>>Although arraigning to build over a cluster would almost certainly be
>>far cheaper. OTOH, I've never looked at the internals of the Boost
>>build system, so I have no idea how hard it would be to get it to do
>>that.
>
>The aforementioned 192-core shared ccNUMA memory system (1TB DRAM) was selling
>for about USD100,000 in 2009. About the same as a simliarly sized cluster
>(16 nodes).
>
>The followon system, which was in design, had 1024 xeon cores instead
>of 192 opteron cores; but the economy stepped in and aborted that plan.


Although a cluster of smaller machines with the same number of cores
would almost certatinly have been a fair bit cheaper. Assuming we're
talking something like PCs where the prices of the low end systems are
substantially less per-MIPS than the big SMPs.

Still, there's no reason not use use all 192 cores for a build if you
have enough RAM and I/O, assuming you have the box already. But if
your application is big builds, a cluster is almost certainly going to
be considerably cheaper since (big) builds are mostly EP.





==============================================================================
TOPIC: Link object files from VC++ and GCC?
http://groups.google.com/group/comp.lang.c++/t/d605f2ea0db15eb9?hl=en
==============================================================================

== 1 of 7 ==
Date: Thurs, Jan 23 2014 9:39 am
From: "Rick C. Hodgin"


Is there a way to link object files between Visual C++ and GCC?

I have some data that I need to encode like this:
char* list[] = {
"one",
"two",
"three",
};

Unfortunately, by default, the list[0], list[1], and list[2] pointers point
to data that's in read-only memory. Any attempt to do something like
memcpy(list[0], "eno", 3) fails with "Access Violation" on Windows.

So, I discovered this syntax in GCC which creates the elements in read-write
memory, allowing memcpy(list[0], "eno", 3) to work properly:
char* list[] = {
(char []) { "one" },
(char []) { "two" },
(char []) { "three" },
};

I need the data pointed to by those list elements to be read-write in my
application. I can use this compound literal syntax in GCC to create
them in read-write memory, and it works in GCC. However, Visual C++
does not support this compound literal syntax and generates about 5
errors per line when I attempt it. :-)

I was wondering if there's a way to link in that one file, which will
contain nothing more than a list like this sample, but with about 100
separate elements in it representing a source code file I need to
modify somewhat at use (replacing placeholders like "[9999]" with the
actual runtime observed values, such as "[ 1]" and so on), to my
Visual C++ generated code in Visual Studio 2008?

I'm looking for something like this:
gcc -c my_list.c
cl /c my_prog.cpp
link my_list.o my_prog.obj my_prog.exe

Thank you in advance.

Best regards,
Rick C. Hodgin




== 2 of 7 ==
Date: Thurs, Jan 23 2014 9:40 am
From: "Rick C. Hodgin"


In the alternative, does anyone know of a version of a Windows-based C/C++
compiler that will honor the compound literal syntax, which will link in
with the correct object format?

Best regards,
Rick C. Hodgin




== 3 of 7 ==
Date: Thurs, Jan 23 2014 10:14 am
From: "Alf P. Steinbach"


On 23.01.2014 18:39, Rick C. Hodgin wrote:
> Is there a way to link object files between Visual C++ and GCC?
>
> I have some data that I need to encode like this:
> char* list[] = {
> "one",
> "two",
> "three",
> };
>
> Unfortunately, by default, the list[0], list[1], and list[2] pointers point
> to data that's in read-only memory. Any attempt to do something like
> memcpy(list[0], "eno", 3) fails with "Access Violation" on Windows.
>
> So, I discovered this syntax in GCC which creates the elements in read-write
> memory, allowing memcpy(list[0], "eno", 3) to work properly:
> char* list[] = {
> (char []) { "one" },
> (char []) { "two" },
> (char []) { "three" },
> };
>
> I need the data pointed to by those list elements to be read-write in my
> application. I can use this compound literal syntax in GCC to create
> them in read-write memory, and it works in GCC. However, Visual C++
> does not support this compound literal syntax and generates about 5
> errors per line when I attempt it. :-)
>
> I was wondering if there's a way to link in that one file, which will
> contain nothing more than a list like this sample, but with about 100
> separate elements in it representing a source code file I need to
> modify somewhat at use (replacing placeholders like "[9999]" with the
> actual runtime observed values, such as "[ 1]" and so on), to my
> Visual C++ generated code in Visual Studio 2008?
>
> I'm looking for something like this:
> gcc -c my_list.c
> cl /c my_prog.cpp
> link my_list.o my_prog.obj my_prog.exe
>

Should work, if you get the name mangling compatible. Since both
compilers use COFF format. But you're barking up the wrong tree: it
doesn't make sense to do this.

First of all you don't need the data to be read/write.

Secondly, if you did need the data to be read/write (which you don't)
it's trivial to specify that:

char item_0[] = "one";

and so on, as long item_0 is static.

Cheers & hth.,

- Alf





== 4 of 7 ==
Date: Thurs, Jan 23 2014 11:20 am
From: Victor Bazarov


On 1/23/2014 12:40 PM, Rick C. Hodgin wrote:
> In the alternative, does anyone know of a version of a Windows-based C/C++
> compiler that will honor the compound literal syntax, which will link in
> with the correct object format?

Why not just use implementation-specific feature in VC++ to place your
data in the read-write memory and go for const-casting it before trying
to change? That's easier than linking GCC obj files with VC++ ones.

You also could simply declare your 'list' as an array of arrays instead
of the array of pointers. That would just as well allow you to edit
those elements:

char list[][10] = { "one", "two", "three" };

It's been a while I used straight chars, though, take it with a grain of
salt. Alternatively, use 'std::string':

std::string list[] = { "one", "two", "three" };
...
list[0]= "eno";

and forget about memcpy...

V
--
I do not respond to top-posted replies, please don't ask




== 5 of 7 ==
Date: Thurs, Jan 23 2014 11:33 am
From: Robert Wessel


On Thu, 23 Jan 2014 09:40:27 -0800 (PST), "Rick C. Hodgin"
<rick.c.hodgin@gmail.com> wrote:

>In the alternative, does anyone know of a version of a Windows-based C/C++
>compiler that will honor the compound literal syntax, which will link in
>with the correct object format?


ICC will probably do it, it implements most GCC extensions.




== 6 of 7 ==
Date: Thurs, Jan 23 2014 11:43 am
From: scott@slp53.sl.home (Scott Lurndal)


"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> writes:
>On 23.01.2014 18:39, Rick C. Hodgin wrote:
>> Is there a way to link object files between Visual C++ and GCC?
>>
>> I have some data that I need to encode like this:
>> char* list[] = {
>> "one",
>> "two",
>> "three",
>> };
>>
>> Unfortunately, by default, the list[0], list[1], and list[2] pointers point
>> to data that's in read-only memory. Any attempt to do something like
>> memcpy(list[0], "eno", 3) fails with "Access Violation" on Windows.
>>
>> So, I discovered this syntax in GCC which creates the elements in read-write
>> memory, allowing memcpy(list[0], "eno", 3) to work properly:
>> char* list[] = {
>> (char []) { "one" },
>> (char []) { "two" },
>> (char []) { "three" },
>> };
>>
>> I need the data pointed to by those list elements to be read-write in my
>> application. I can use this compound literal syntax in GCC to create
>> them in read-write memory, and it works in GCC. However, Visual C++
>> does not support this compound literal syntax and generates about 5
>> errors per line when I attempt it. :-)
>>
>> I was wondering if there's a way to link in that one file, which will
>> contain nothing more than a list like this sample, but with about 100
>> separate elements in it representing a source code file I need to
>> modify somewhat at use (replacing placeholders like "[9999]" with the
>> actual runtime observed values, such as "[ 1]" and so on), to my
>> Visual C++ generated code in Visual Studio 2008?
>>
>> I'm looking for something like this:
>> gcc -c my_list.c
>> cl /c my_prog.cpp
>> link my_list.o my_prog.obj my_prog.exe
>>
>
>Should work, if you get the name mangling compatible. Since both
>compilers use COFF format. But you're barking up the wrong tree: it
>doesn't make sense to do this.

gcc hasn't used COFF format for over a decade or more. ELF has been
the standard on unix and unix-like operating systems since 1990.

You are correct, however, in that it doesn't make any sense to do this.




== 7 of 7 ==
Date: Thurs, Jan 23 2014 11:52 am
From: scott@slp53.sl.home (Scott Lurndal)


scott@slp53.sl.home (Scott Lurndal) writes:
>"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> writes:

>>Should work, if you get the name mangling compatible. Since both
>>compilers use COFF format. But you're barking up the wrong tree: it
>>doesn't make sense to do this.
>
>gcc hasn't used COFF format for over a decade or more. ELF has been
>the standard on unix and unix-like operating systems since 1990.

My Bad - missed the windows references. Not surprising that they're
25 years out of date :-)





==============================================================================
TOPIC: goto label inside of if statement
http://groups.google.com/group/comp.lang.c++/t/7c222b0d5330287c?hl=en
==============================================================================

== 1 of 2 ==
Date: Thurs, Jan 23 2014 11:32 am
From: W Karas


I was surprised to find that this code:

struct A { A(); ~A(); };

void bar();

void foo(bool f)
{
if (0)
{
LAB: ;
}
else
{
A a;

if (f) goto LAB;

bar();
}
}

will compile without warnings using GCC 4.7.3, even with -Wall and -Wextra .

The point, in case you were wondering, would be a macro-based "named block" pseudo-construct, where the block could be exited from any depth of block nesting, for example:

#define BLOCK(NAME) if (0) { NAME: ; } else
#define EXITBLOCK(NAME) goto NAME;

struct A { A(); ~A(); };

void bar();

void foo(bool f)
{
BLOCK(XYZ)
{
A a;

if (f) EXITBLOCK(XYZ)

bar();
}
}




== 2 of 2 ==
Date: Thurs, Jan 23 2014 11:55 am
From: Victor Bazarov


On 1/23/2014 2:32 PM, W Karas wrote:
> I was surprised to find that this code:
>
> struct A { A(); ~A(); };
>
> void bar();
>
> void foo(bool f)
> {
> if (0)
> {
> LAB: ;
> }
> else
> {
> A a;
>
> if (f) goto LAB;
>
> bar();
> }
> }
>
> will compile without warnings using GCC 4.7.3, even with -Wall and -Wextra .
>
> The point, in case you were wondering, would be a macro-based "named block" pseudo-construct, where the block could be exited from any depth of block nesting, for example:
>
> #define BLOCK(NAME) if (0) { NAME: ; } else
> #define EXITBLOCK(NAME) goto NAME;
>
> struct A { A(); ~A(); };
>
> void bar();
>
> void foo(bool f)
> {
> BLOCK(XYZ)
> {
> A a;
>
> if (f) EXITBLOCK(XYZ)
>
> bar();
> }
> }
>

And it actually skips the 'else' part when jumping into the 'if'
section, yes? And how well do optimizers handle it?

V
--
I do not respond to top-posted replies, please don't ask




==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.c++"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.c++?hl=en

To unsubscribe from this group, send email to comp.lang.c+++unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c++/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

No comments: