HN user

NotPaidToPost

8 karma
Posts1
Comments320
View on HN

This is one of the major cause of the destruction of the environment we're seeing globally.

All forecasts predict another 60% (!!) increase in global population before it stabilises.

Forget about banning plastic straws or flying less (which are feel-good measures more than anything else) with such numbers... We need to take dramatic and effective steps.

There are 80 years left until the end of the century. This increase is far from being inevitable! But, again, we prefer to ignore these key issues and focus on marginal, feel-good measures instead.

But why limit it to 2^ and 10^ and not say literal^literal should always produce a warning?

You're suggesting that using the C language as specified and intended should produce a warning... That makes no sense.

It's not for you or the compiler to decide that 2^32 makes no sense. It is using ^ exactly as intended and is neither misleading nor ambiguous.

Stating that 32^2 should not trigger a warning while 2^32 should shows that this proposal has not been thought through.

It's not desirable or sensible to raise a warning on the premise that the expression might mean something else in another language, which is what this would do.

How do you do that?

The preprocessor does macro expansion, the compiler compiles the result.

The compiler does not see FLAG_BIT1 ^ FLAG_BIT3, it only sees the result, e.g. 2^32.

Therefore to catch only explicit 2^32 the warning should come from the preprocessor... Nice mess created right there.

'If' expects a condition so finding an assignment may be a red flag even if an assignment has a return value in the spec, which makes the construct valid.

On the other hand ^ expects integers so 2^32 is exactly what is expected.

Most the replies I saw here try to second-guess or claim that ^ should be used in a specific way. Not so, ^ is just doing XOR of two integers.

Apparently, I am having an incorrect opinion, though, so I will self-censor and remain silent.

It's a warning not an error.

Many build environments are set to treat all warnings as errors.

The point is that 2^32 is a perfectly compliant C expression that is neither misleading nor ambiguous, and that also won't create any variable overflow. It uses ^ exactly as intended. Why should the compiler complain? Why should I get a warning/error when following the spec to the letter?

I don't think it would not be simple or a good idea to warn because these are perfectly valid expressions and it would lead to a flood of warnings if compilers started to display "Did you really mean that?" for an ever growing list of expressions (which is what it would become).

Better to leave this to code analysis tools.

Edit:

2^32 uses the ^ operator exactly as intended, and has perfectly legitimate uses, especially when dealing with registers of HW peripherals.

It's not the same as warning on "if (a=b)" as someone replied.

From a language perspective, 2^32 is exactly the same as 2+32.

Your comment suggests that there is a correct opinion and an incorrect opinion. This is as totalitarian as the "other side".

This issue of extradition is far from being black and white.

It is a rethoric and disingenuous argument to call for a referendum. See Crimea.

The problem is states competing against each other and they know that HK is a way to create trouble for China.

What I wrote is not an allegation. It is a fact as there is currently no extradition from HK to Macau/mainland China/Taiwan.

The whole bill was brought forward because of a HK resident accused of murdering his girlfriend in Taiwan and who fled back to HK. You can say that this was a pretext to bring the bill forward but it still highlights a real issue.

The Taiwanese government is being cynical here.

It's also difficult to see how this bill would "subjugate" HK if passed.

I do agree that the HK courts would need to be very thorough in considering extradition requests from the mainland and that their independence should be preserved.

Ironically, in failing, it has shown Xi’s limited power

Or perhaps people are assuming that "one country, two systems" is a sham when it actually isn't.

Forced opium trade, war, forcibly seizing foreign territory do seem like mistakes.

HK's retrocession to China was the right thing to do.

Unfortunately it seems that it is very hard for Britain to get over its lost Empire. They should really move on.

I think the underlying assumption in those comparisons is that Bitcoin is essentially useless.

So while Hamburg produces CO2 because of all the people and economic activity going there, Bitcoin produces the same amount for no actual benefits. In that case the comparison does illustrate the amount of waste.

Now, on the other hand if you're of the opinion that Bitcoin is something of value that makes a positive difference and produces something useful then the comparison does look random and nonsensical.

This is a flamebait comment, frankly, and unsubstantive comments are banned on HN.

Nepal has never been under Chinese rule and has never been claimed by China. Tibet was part of the Chinese empire before breaking away with the very interested help of the Brits, who did try to invade Nepal as well.

Learning to speak mandarin is not difficult and arguably the grammar is simpler than in English. Learning to read and write is difficult because of the quantity but characters are highly structured. It's interesting and I don't see what there should be any "resistance" from the students.

Nepal has a border with China, it does seem like a good idea to teach Chinese in schools. Like it makes sense for China to promote this.

The state of the media when this anecdote from a remote country makes headlines all over the place... With the usual suggestions of sinister motives.

Lastly, I can only applaud Taiwan for standing against this bill in their own way by refusing to use it even if it were passed.

It's difficult to see what's commendable in effectively approving that people may evade Taiwanese justice by hiding in HK just for the sake scoring PR points against the mainland at a time when elections are coming up.

This is the worst level of populism, frankly, and transparently insincere.

It may actually backfire because that bill was partly brought forward because of the outrage caused by doing exactly that (evading Taiwanese justice by fleeing to HK).

The Chinese government does not like "waves". They probably don't want such waves even more at the moment.

It's not a question of supporting the bill but of question of supporting the HK government despite the unrest it will create.

The Chinese government may conclude (and may have concluded) that at the moment there are much more pressing problems and that they could do without riots in HK.