Tutorial  Updated

How to make compiling neater

I was having trouble spotting any warnings because the output when compiling is so messy. Fixing that is pretty simple.

Why you should do it.
The warnings (and errors, if there were any) stick out like a sore thumb because they are so much longer. Take a look at the build output before and after following the instructions in this guide.
Before:
Code:
C:\projects\3ds\Pasta-CFW\CFW_loader>make
crypto.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/crypto.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/crypto.c -o crypto.o
draw.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/draw.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/draw.c -o draw.o
fs.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/fs.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c -o fs.o
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'DecryptPartition':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:95:9: warning: unused variable 'bytesWritten' [-Wunused-variable]
  size_t bytesWritten;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'InitializeNandCrypto':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:118:8: warning: unused variable 'listSystem' [-Wunused-variable]
  char* listSystem[] = { "4.x", "6.x", "7.x", "9.x" };
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:151:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:164:2: warning: implicit declaration of function 'sdmmc_nand_readsectors' [-Wimplicit-function-declaration]
  sdmmc_nand_readsectors(sector_no + partition / 0x200, numsectors, out);
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:172:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:193:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:205:2: warning: implicit declaration of function 'sdmmc_sdcard_readsectors' [-Wimplicit-function-declaration]
  sdmmc_sdcard_readsectors(sector_no + partition / 0x200, numsectors, out);
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:213:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:226:2: warning: implicit declaration of function 'sdmmc_sdcard_writesectors' [-Wimplicit-function-declaration]
  sdmmc_sdcard_writesectors(sector_no + partition / 0x200, numsectors, out); //Stubbed, i don't wanna risk
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:166:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:187:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:207:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:227:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
hid.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/hid.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/hid.c -o hid.o
i2c.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/i2c.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/i2c.c -o i2c.o
c:/projects/3ds/Pasta-CFW/CFW_loader/source/i2c.c:6:43: warning: no semicolon at end of struct or union
static const struct { u8 bus_id, reg_addr } dev_data[] = {
  ^
main.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/main.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/main.c -o main.o
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c: In function 'CFW_NandDumper':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c:299:23: warning: initialization makes pointer from integer without a cast
  unsigned char* buf = 0x21000000;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c:319:5: warning: implicit declaration of function 'sdmmc_nand_readsectors' [-Wimplicit-function-declaration]
  sdmmc_nand_readsectors(count*nsectors, nsectors, buf);
  ^
platform.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/platform.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/platform.c -o platform.o
diskio.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/diskio.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs/diskio.c -o diskio.o
ff.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/ff.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs/ff.c -o ff.o
delay.s
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/delay.d -x assembler-with-cpp -g -mthumb -mthumb-interwork -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/delay.s -o delay.o
start.s
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/start.d -x assembler-with-cpp -g -mthumb -mthumb-interwork -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/start.s -o start.o
linking CFW_loader.elf
built ... CFW_loader.bin
cp /c/projects/3ds/Pasta-CFW/CFW_loader/CFW_loader.bin loader.bin
cp /c/projects/3ds/Pasta-CFW/CFW_loader/CFW_loader.elf loader.elf
After:
Code:
C:\projects\3ds\Pasta-CFW\CFW_loader>make
crypto.c
draw.c
fs.c
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'DecryptPartition':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:95:9: warning: unused variable 'bytesWritten' [-Wunused-variable]
  size_t bytesWritten;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'InitializeNandCrypto':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:118:8: warning: unused variable 'listSystem' [-Wunused-variable]
  char* listSystem[] = { "4.x", "6.x", "7.x", "9.x" };
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:151:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:164:2: warning: implicit declaration of function 'sdmmc_nand_readsectors' [-Wimplicit-function-declaration]
  sdmmc_nand_readsectors(sector_no + partition / 0x200, numsectors, out);
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:172:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:193:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:205:2: warning: implicit declaration of function 'sdmmc_sdcard_readsectors' [-Wimplicit-function-declaration]
  sdmmc_sdcard_readsectors(sector_no + partition / 0x200, numsectors, out);
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:213:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:226:2: warning: implicit declaration of function 'sdmmc_sdcard_writesectors' [-Wimplicit-function-declaration]
  sdmmc_sdcard_writesectors(sector_no + partition / 0x200, numsectors, out); //Stubbed, i don't wanna risk
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:166:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:187:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:207:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:227:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
hid.c
i2c.c
c:/projects/3ds/Pasta-CFW/CFW_loader/source/i2c.c:6:43: warning: no semicolon at end of struct or union
static const struct { u8 bus_id, reg_addr } dev_data[] = {
  ^
main.c
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c: In function 'CFW_NandDumper':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c:299:23: warning: initialization makes pointer from integer without a cast
  unsigned char* buf = 0x21000000;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c:319:5: warning: implicit declaration of function 'sdmmc_nand_readsectors' [-Wimplicit-function-declaration]
  sdmmc_nand_readsectors(count*nsectors, nsectors, buf);
  ^
platform.c
diskio.c
ff.c
delay.s
start.s
sdmc.s
linking CFW_loader.elf
built ... CFW_loader.bin
cp /c/projects/3ds/Pasta-CFW/CFW_loader/CFW_loader.bin loader.bin
cp /c/projects/3ds/Pasta-CFW/CFW_loader/CFW_loader.elf loader.elf
In addition to that, it's easy to see when there are no more warnings or errors. Here's a build where all the warnings have been fixed (different project):
Code:
C:\projects\3ds\3ds_hb_menu>make
app_bubble.bin
battery_charging.bin
battery_full.bin
battery_low.bin
battery_lowest.bin
battery_mid_high.bin
battery_mid_low.bin
bubble.bin
font.bin
installerIcon.bin
logo.bin
regionfree.bin
top_bar.bin
wifi_full.bin
wifi_none.bin
descriptor.cpp
tinyxml2.cpp
background.c
boot.c
error.c
filesystem.c
font.c
font1.c
font2.c
gfx.c
main.c
menu.c
netloader.c
regionfree.c
scanner.c
smdh.c
statusbar.c
text.c
titles.c
water.c
linking 3ds_hb_menu.elf
built ... 3ds_hb_menu.3dsx
A quick scroll through the output is all it takes to see that there are no warnings or errors.

How to do it
Making a clean output could hardly be simpler, and it isn't project-specific. All you need to do is open "C:\devkitPro\devkitARM\base_rules" with a text editor and replace the contents with this. It has no negative effects.
 
Last edited by JoostinOnline,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,029
Country
United States
This is completely the opposite of that. It makes spotting warnings easier. It hides the pointless commands. Read the first line of "Why you should do it".
Ahh... I see that makes sense. I did not realize the clean output at the end was after the fixing the warnings. I thought it was just hiding them.
 

mashers

Stubborn ape
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
You can achieve the same result by using "make -s". It inhibits the echoing of the individual compiler commands so you can more easily see any errors and warnings.
 

JoostinOnline

Certified Crash Test Dummy
OP
Member
Joined
Apr 2, 2011
Messages
11,005
Trophies
1
Location
The Twilight Zone
Website
www.hacksden.com
XP
4,338
Country
United States
You can achieve the same result by using "make -s". It inhibits the echoing of the individual compiler commands so you can more easily see any errors and warnings.
True, but it has two downsides. The first is minor, in that you have to type -s every time. The second is bigger. You will have to modify every batch/bash script by adding a -s command, and the commands used in any tools if you compile through Programmer's Notepad.

This is a simple way that requires no changes to project files.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • LeoTCK @ LeoTCK:
    telling him that my partner is luke...does he look like someone with such big ne
    eds?
  • LeoTCK @ LeoTCK:
    do you really think I could stand living with someone like luke?
  • LeoTCK @ LeoTCK:
    I suppose luke has "special needs" but he's not my partner, did you just say that to piss me off again?
  • LeoTCK @ LeoTCK:
    besides I had bigger worries today
  • LeoTCK @ LeoTCK:
    but what do you know about that, you won't believe me anyways
  • K3Nv2 @ K3Nv2:
    @BigOnYa can answer that
  • BigOnYa @ BigOnYa:
    BigOnYa already left the chat
  • K3Nv2 @ K3Nv2:
    Biginya
  • BigOnYa @ BigOnYa:
    Auto correct got me, I'm on my tablet, i need to turn that shit off
  • K3Nv2 @ K3Nv2:
    With other tabs open you perv
  • BigOnYa @ BigOnYa:
    I'm actually in my shed, bout to cut 2-3 acres of grass, my back yard.
  • K3Nv2 @ K3Nv2:
    I use to have a guy for that thanks richard
  • BigOnYa @ BigOnYa:
    I use my tablet to stream to a bluetooth speaker when in shed. iHeartRadio, FlyNation
  • K3Nv2 @ K3Nv2:
    While the victims are being buried
  • K3Nv2 @ K3Nv2:
    Grave shovel
  • BigOnYa @ BigOnYa:
    Nuh those goto the edge of the property (maybe just on the other side of)
  • K3Nv2 @ K3Nv2:
    On the neighbors side
    +1
  • BigOnYa @ BigOnYa:
    Yup, by the weird smelly green bushy looking plants.
  • Xdqwerty @ Xdqwerty:
    Water park was quite fun
  • NinStar @ NinStar:
    die?
  • LeoTCK @ LeoTCK:
    yes I'm in mortal danger
    LeoTCK @ LeoTCK: yes I'm in mortal danger