Go to advanced search

by jahboater
Fri Apr 07, 2017 2:29 pm
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13488

Re: Writing clean code isn't hard!

Well, at least you have done the investigation, proved its a false positive and can now safely remove those flags! I guess its difficult, and perhaps too much to ask, but could you reproduce the problem in a small, self contained piece of code? If so, and it fails with gcc 6.3, I should perhaps subm...
by jahboater
Fri Apr 07, 2017 1:41 pm
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13488

Re: Writing clean code isn't hard!

I'm definitely not going to use them as they seem to warn against what is perfectly valid C ! I don't see how your code isn't falling foul of them like mine does. PeterO Neither do I (understand). I tried and its clean with gcc 4.9 and gcc 6.3. And its a larger program (over 15,000 lines). I have a...
by jahboater
Fri Apr 07, 2017 1:31 pm
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13488

Re: Writing clean code isn't hard!

Interesting!
What version of the compiler are you using?
Messages from gcc have improved quite a bit recently.
by jahboater
Fri Apr 07, 2017 12:36 pm
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13488

Re: Writing clean code isn't hard!

I can't live with some of those warnings !! My code is careful to make sure functions come before their first use thus avoiding lots of pointless prototypes. I've had to disable the warnings that complain if functions are not prototyped even when they are defined before they are used. Are you sure?...
by jahboater
Fri Apr 07, 2017 11:33 am
Forum: C/C++
Topic: Learning C in 5 minutes
Replies: 48
Views: 8092

Re: Learning C in 5 minutes

Another good reason to use <stdint.h>, you are constantly aware how big your integer variables actually are.
by jahboater
Fri Apr 07, 2017 11:21 am
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13488

Re: Writing clean code isn't hard!

-Wall/-Wextra surprisingly doesn't cover all that much, I don't know why more options are not included. For example, daft code like: static const char mystr[] = "asasdddad"; char *ptr = (char*)mystr; *ptr = 'x'; will likely crash the program and I would always want to know about it (-Wcast-qual is n...
by jahboater
Fri Apr 07, 2017 10:41 am
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13488

Re: Writing clean code isn't hard!

I find -Wconversion produces "noise" from my code. I'm quite happy to let the compiler silently deal with some implicit type conversions in my code. Fair enough. For interest ... It does "Warn for implicit conversions that may alter a value" (man gcc), benign conversions are silent . int32_t n; dou...
by jahboater
Fri Apr 07, 2017 8:29 am
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13488

Re: Writing clean code isn't hard!

That's Over 7000 lines of code compiled with -Wall -Wextra -Wpedantic with no warnings..... It can be done if you actually take time and care about what you are doing ! PeterO And its best done from the start , then its relatively easy. I suggest adding -Wconversion to the minimum warning flags abo...
by jahboater
Fri Apr 07, 2017 8:15 am
Forum: C/C++
Topic: Learning C in 5 minutes
Replies: 48
Views: 8092

Re: Learning C in 5 minutes

Its always worth checking the return from file handling functions:

Code: Select all

if( (fp = fopen("filename.txt","rb")) == NULL )
    ... fail gracefully
by jahboater
Thu Apr 06, 2017 5:41 pm
Forum: General discussion
Topic: Hello... Where do I start, what are stickies?
Replies: 8
Views: 1672

Re: Hello

texy wrote:Hi and welcome to the forum.
That just really means to check if your specific problem hasn't already been address in one of the sickies, or other threads.
Perhaps "stickies"!
by jahboater
Thu Apr 06, 2017 5:34 pm
Forum: Staffroom, classroom and projects
Topic: Stabilizing RPi3 speed for my classes
Replies: 10
Views: 5211

Re: Stabilizing RPi3 speed for my classes

I modify the file and check the content (cat boot/config.txt). Everything seems OK. If I eject the sdcard and plug it in again, the file shows the original content. No modification. Perhaps type "sync" and/or properly unmount the filesystem before ejecting the card. You must not simply pull the car...
by jahboater
Thu Apr 06, 2017 5:09 pm
Forum: Teaching and learning resources
Topic: ARM assembly textbook suggestions
Replies: 2
Views: 2509

Re: ARM assembly textbook suggestions

Hello everyone, Which book would you suggest to learn ARM assembly? I'm looking at ARM Assembly Language: Fundamentals and Techniques, Second Edition by William Hohl & Christopher Hinds. It seems like a good book but it's center around ARM7 and not ARMv8 like the rp3. I have that book, and I can re...
by jahboater
Thu Apr 06, 2017 12:56 pm
Forum: General discussion
Topic: Overheating dangers between RP2 vs RP3
Replies: 27
Views: 3236

Re: Overheating dangers between RP2 vs RP3

Also, please ignore the usual conspiracy theories about Wifi 'radiation' being bad for you. It isn't. You get more ionising radiation from a human body due to the decay of C14 than you do from a wireless router. Its probably the heating effect people (needlessly) worry about. 2.4GHz is close to the...
by jahboater
Thu Apr 06, 2017 11:37 am
Forum: General discussion
Topic: Overheating dangers between RP2 vs RP3
Replies: 27
Views: 3236

Re: Overheating dangers between RP2 vs RP3

Or simply provide a way of powering off the Wifi chip from within raspi-config.
Cheaper than two separate products.

I keep my seeds in the garden shed, so I'm OK ...
by jahboater
Thu Apr 06, 2017 10:54 am
Forum: General discussion
Topic: Overheating dangers between RP2 vs RP3
Replies: 27
Views: 3236

Re: Overheating dangers between RP2 vs RP3

What does the cpuburn utility do, exactly ? It runs some NEON SIMD instructions on all four cores (I think its doing at least 16 operations per cycle maybe more because NEON is now quad issue). I have found it heats up the CPU quicker than anything else. You can examine the code in cpuburn-a53.S Wh...
by jahboater
Thu Apr 06, 2017 10:12 am
Forum: General discussion
Topic: Overheating dangers between RP2 vs RP3
Replies: 27
Views: 3236

Re: Overheating dangers between RP2 vs RP3

It turns out there are lots and lots of videos on youtube where people do their own experiments, using utilities like sysbench, to figure out how hot the RP3 gets. The answer is... over 80 degrees in 5 to 10 minutes ! Try this ... wget https://raw.githubusercontent.com/ssvb/cpuburn-arm/master/cpubu...
by jahboater
Thu Apr 06, 2017 8:04 am
Forum: Raspberry Pi OS
Topic: Raspbian Jessie
Replies: 2
Views: 633

Re: Raspbian Jessie

In fact, I have seen some references that indicate that Raspbian Jessie automatically places /var/run in RAM upon boot. Please tell me if in fact that is what Raspbian Jessie does, does this mean that MySQL's socket communications are actually already occurring in RAM and if so is what I am attempt...
by jahboater
Thu Apr 06, 2017 7:32 am
Forum: General discussion
Topic: Re-formatting the SD card
Replies: 25
Views: 111488

Re: Re-formatting the SD card

If you don't need noobs, simply put the new OS on the card without formatting it first. https://www.raspberrypi.org/downloads/raspbian/ and follow the instructions (which work on Windows, Mac, or Linux - probably easiest on Linux as the tools are standard). There is never any need to delete partitio...
by jahboater
Wed Apr 05, 2017 11:00 am
Forum: General discussion
Topic: Overheating dangers between RP2 vs RP3
Replies: 27
Views: 3236

Re: Overheating dangers between RP2 vs RP3

I'm interested by your suggestion that the life-span of the Pi might be measured in decades. RP's are new devices... so there can't be empirical evidence. Where did you read this idea ? Do you have a link to that ? Thanks again for your help :) Various quotes from RPF engineers over the years. Orig...
by jahboater
Wed Apr 05, 2017 10:34 am
Forum: HATs and other add-ons
Topic: Misconceptions about WiFi Antenna
Replies: 3
Views: 629

Re: Misconceptions about WiFi Antenna

There are several things wrong with those statements. Changing the antenna does not "increases the transmit radiated power", the antenna is passive, only an amplifier can increase the transmitted power. It might increase the Effective Isotropic Radiate Power (eirp) but that is not the same thing ! ...
by jahboater
Wed Apr 05, 2017 9:16 am
Forum: General discussion
Topic: Memory expansion for RP2 / RP3
Replies: 7
Views: 1081

Re: Memory expansion for RP2 / RP3

If you do get short of memory, there is a Lite version of Rasbian with no GUI (often used for headless installations) that is rather smaller.
by jahboater
Wed Apr 05, 2017 9:03 am
Forum: General discussion
Topic: Memory expansion for RP2 / RP3
Replies: 7
Views: 1081

Re: Memory expansion for RP2 / RP3

Hi there, just a quick question concerning the possibility of expanding the memory on the RP2 and/or RP3. Are there any reasons why i couldn't expand the memory to 2 gig or 4 gig ? For example firmware limitations or chip specifications or space or on the RP board ? No (chip limits). Why do you nee...
by jahboater
Wed Apr 05, 2017 8:45 am
Forum: General discussion
Topic: Overheating dangers between RP2 vs RP3
Replies: 27
Views: 3236

Re: Overheating dangers between RP2 vs RP3

The new Pi2 (v1.2) has the same ARMv8 based SoC as the Pi3 but is clocked at 900Mhz instead of 1.2GHz for the Pi3. You are free to downclock the Pi3 to any speed you like. In any case the Pi's lifetime is measured in decades. The Pi will protect itself by progressively throttling the clock speed bac...
by jahboater
Wed Apr 05, 2017 7:47 am
Forum: Raspberry Pi OS
Topic: Raspian easy install. Instant networking and SSH.
Replies: 8
Views: 1540

Re: Raspian easy install. Instant networking and SSH.

I installed a fresh Raspian today using your instructions. Wifi and SSH instantly up. Your prescription should really be part of the official installation instructions. Thanks again H Well done! If your PC runs Linux, then you can mount the second ext4 partition and make any changes you like to tha...

Go to advanced search